[Newbie] Project design problem

Charles Hixson charleshixsn at earthlink.net
Sun Oct 2 03:32:43 UTC 2005


Please, any advice or suggestions would be appreciated.

I thought that as my first "major" Squeak project, I'd translate a game 
that I had written in Ruby...but the concept seems wrong.

In the original game a tile (gtk: label) with a series of letters would 
display at the top of the screen, and below it there would be four 
pictures (xpm, gif, whatever was convenient) on "buttons".  Clicking the 
button that matched the tile would advance to a new scenario with a 
different label and different pictures.   (In this particular game it 
was music note names and images of the note on either a bass or a treble 
staff.)

In the original, the images were left on the disk, and only read in as 
needed (to conserve memory).

In Squeak...well, in the first place I can't figure out how to read a 
note and place it on a button (which is only then "opened in the 
world").  Squeak appears to want the images to be read in ahead of time, 
one by one, and placed by hand, but I suspect that this is my 
inexperience.  Also, when the image is read in, it seems to be assigned 
an arbitrary ID (reasonable), but what I would want to do is to store 
them in an ordered collection, and access them by ???? name? index? octave?

If I could read in an image and place it into a button, then I could do 
a straight translation.  But would this be the proper approach?  I 
thought I might find the proper approach by studying the code for the 
FreeCell game, as in many ways it appears to be a similar problem, but 
the approach they take appears to be drawing the images on the fly, and 
the thought of trying to program the drawing of bass and treble signs 
fills me with such trepidation that I feel this MUST be the wrong approach.






More information about the Squeak-dev mailing list