I just started with the game tutorial and was able to figure out how to
add the Laser-Game-Model etc to the system browser but how do I add the subclasses such as BlankCell, Grid, MirrorCell, TargetCell?
Any help on how to use the System Browser would be great.
When you select the Laser-Game-Model category, you see a class creation template on the bottom pane of the Browser. Fill it out as shown, then right-click and press "accept" (or press the keystroke alt-s/cmd-s, depending on platform)
I am CC'ing this to Stephan; Stephan, could you add these instructions to page
Great I got the message on how to do the subclass but how do you create a new protocol? tests etc etc In the tut on game.
Sorry if I am a pain but I would real like to learn this and the game tut is got me very interested. Any help is great
Chuck
On Sun, Jul 08, 2007 at 06:18:54PM -0600, Chuck Smith wrote:
Great I got the message on how to do the subclass but how do you create a new protocol? tests etc etc In the tut on game.
Sorry if I am a pain but I would real like to learn this and the game tut is got me very interested. Any help is great
Your comments are very useful. After a while, one forgets what it is like to be new to something. Thanks for reminding us. Here is my addition to the tutorial that answers your question. It is meant to go in between the two images at http://squeak.preeminent.org/tut2007/html/015A.html
To help keep classes organized, Squeak provides method categories for each class. Method categories are sometimes called protocols. Create a new protoocol called tests. Right-click on the third pane (the protocol list), and select <i> New Category -> new... </i> Enter the name "tests":
http://img472.imageshack.us/img472/3130/042aox0.jpg
Now, create a method called testCellOnState. Like with class creation and editing, we do this by editing the code in the lower pane:
Stephan: could you add this to the tutorial? I had named the screenshot 042A.jpg in keeping with your naming convention, but imageshack changed it.
beginners@lists.squeakfoundation.org