Hi guys
It was for so long on my todo list that I decided to start addressing it. I publish games that were defined long time ago in Squeak. - Tetris - Miners - SameGame - ChineseCheckers There are now available via the metarepository configuration browser I will continue to publish some others. Stef |
Stef, Thanks so much! I love this because its fun to analyze the code and learn from it. Best Nacho Lic. Ignacio Sniechowski, MBA Prosavic SRL Tel: (011) 4542-6714 On Sun, Feb 8, 2015 at 6:28 AM, stepharo <[hidden email]> wrote:
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
|
very cool ! 2015-02-08 12:05 GMT+01:00 Ignacio Sniechowski <[hidden email]>:
|
Thank you Stef, its great to have some games for Pharo :) Some issues 1) I cannot find ChineseChekers in conf browser 2) None of the 3 games comes with an easy way to open them. I had to use $GameName$ new openInWindow. 3) Tetris is giving me a MNU apparently it does not find the LedMorph class it needs. 4) Miners was displaying some weird artefacts when I hit a mine. They dont go away when I hit new game. On Sun, Feb 8, 2015 at 2:27 PM, olivier auverlot <[hidden email]> wrote:
|
In reply to this post by nacho
Pay attention, most of them should be cleaned and probably rewritten
:)
Now I would love to have a framework to build games if you are interested contact me. The idea is that we have often a board tiles level... We should redo the graphics. PS: I published but not migrated FreeCell Crostic I should migrate sokoban and a couple of others Stef Le 8/2/15 12:05, Ignacio Sniechowski a
écrit :
|
In reply to this post by kilon.alios
I fixed the configurationOfTetris but I cannot publish it to
MetaRepoForPharo40.
Can you copy it from my repo and try? I will verify all the others. |
In reply to this post by kilon.alios
Le 8/2/15 17:39, kilon alios a écrit :
Indeed I developed in a "old pharo 40 image" and it works. Now I can reproduce the problem so I will have a look at it. Stef
|
In reply to this post by kilon.alios
why I think that such games should be rewritten: crying for a
subclass :)
drawOn: aCanvas "Draw a rectangle with a solid, inset, or raised border. Note: the raised border color *and* the inset border color are generated from the receiver's own color, instead of having the inset border color generated from the owner's color, as in BorderedMorph." | font rct | borderWidth = 0 ifTrue: [ "no border" aCanvas fillRectangle: bounds color: color. ^ self.]. borderColor == #raised ifTrue: [ ^ aCanvas frameAndFillRectangle: bounds fillColor: color borderWidth: borderWidth topLeftColor: color lighter lighter bottomRightColor: color darker darker darker]. borderColor == #inset ifTrue: [ aCanvas frameAndFillRectangle: bounds fillColor: color borderWidth: 1 " borderWidth" topLeftColor: (color darker darker darker) bottomRightColor: color lighter. self isMine ifTrue: [ font := StrikeFont familyName: 'Atlanta' size: 22 emphasized: 1. rct := bounds insetBy: ((bounds width) - (font widthOfString: '*'))/2@0. rct := rct top: rct top + 1. aCanvas drawString: '*' in: (rct translateBy: 1@1) font: font color: Color black. ^ aCanvas drawString: '*' in: rct font: font color: Color red .]. self nearMines > 0 ifTrue: [ font := StrikeFont familyName: 'ComicBold' size: 22 emphasized: 1. rct := bounds insetBy: ((bounds width) - (font widthOfString: nearMines asString))/2@0. rct := rct top: rct top + 1. aCanvas drawString: nearMines asString in: (rct translateBy: 1@1) font: font color: Color black. ^ aCanvas drawString: nearMines asString in: rct font: font color: ((palette at: nearMines) ) .]. ^self. ]. "solid color border" aCanvas frameAndFillRectangle: bounds fillColor: color borderWidth: borderWidth borderColor: borderColor. Le 8/2/15 17:39, kilon alios a écrit :
|
In reply to this post by stepharo
yes it works and I took the liberty to commit to the meta repo for pharo 4 , well done Stef :) On Sun, Feb 8, 2015 at 7:49 PM, stepharo <[hidden email]> wrote:
|
In reply to this post by stepharo
wow if you turn it upside down it reads "written in C" ;D Definetly not ideal example code for beginners , but I am grateful someone actually bothered writing that code so I and other newcomers learn a bit more about Morphic. On Sun, Feb 8, 2015 at 7:56 PM, stepharo <[hidden email]> wrote:
|
In case of mines I see now that each opened cell is a red box of doom . Apparently the morph DNU fontOfSize . Looks like StrikeFont class is the culprit used in MinesTile>>drawOn: |
I fixed it.
Now this is a good example on how an application should embed its fonts. Stef Le 8/2/15 19:12, kilon alios a écrit : > > In case of mines I see now that each opened cell is a red box of doom . > > Apparently the morph DNU fontOfSize . Looks like StrikeFont class is > the culprit used in MinesTile>>drawOn: > > |
Well done Stef . The artefact problem is gone and I have committed your configuration to MetaRepo4. On Sun, Feb 8, 2015 at 8:30 PM, stepharo <[hidden email]> wrote: I fixed it. |
Thanks I do not get why it does not work with me. O_o
Le 8/2/15 20:07, kilon alios a écrit :
In fact this is a good example on why an application should embed its fonts and I would like to have a solution for that.
|
Does pharo come with its own standard TTFs ? I am unfamiliar with how fonts work in Pharo exactly will take a look at mines and see what I can understand. On Sun, Feb 8, 2015 at 11:11 PM, stepharo <[hidden email]> wrote:
|
You have basically
logicalfont that describes what you want then a logicial font is checking reality and you get a Strikefont? or a FT Now htere were many patches and globals so this part would really need to cleaning such StandardFonts which is a kind of registry. Especially because FT are not polymorphic with StrikeFont. Le 8/2/15 22:33, kilon alios a écrit :
|
Hi , I developed some little games in distribution v3 (seems they work fine in v4 except perhaps some visual difference). If you want to take a look at them (feedback is welcome) they are here MCSmalltalkhubRepository owner: 'squidik' project: 'Games' user: '' password: nil Love, Laura On Mon, Feb 9, 2015 at 5:04 PM, stepharo <[hidden email]> wrote:
|
Cool!
I will have a look :) Le 9/2/15 21:11, Laura Risani a écrit :
|
In reply to this post by laura
Impressive! I love your tetris. In the Sudoku you should put bigger numbers, they are too small. The eater I think is still work in progress, isn't it? Would you wirte a tutorial on how do you develop the Tetris or the Sudoku? It would be great! thank Nacho Lic. Ignacio Sniechowski, MBA Prosavic SRL Tel: (011) 4542-6714 On Mon, Feb 9, 2015 at 5:11 PM, Laura Risani <[hidden email]> wrote:
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
|
Le 9/2/15 21:34, Ignacio Sniechowski a
écrit :
Me too :) Laura if you give me access to your repo I will do a little formatting pass on some code. I like that you have a model and a separate representation. Now I will play with the other ones :)
|
Free forum by Nabble | Edit this page |