Hi
I'm building a breakOut for my book and I have the following problem.
I have one object that contains the score of the game that get increased each time a brick is destroyed.
Now I copied a bit the code of the SameGame to get a list of button around my game field and in particular I want to display the score. So here is my question.
In VisualWorks I would changed the Field score instance variable into a value holder and I will initialize the BreakOut class to get notify whether the score variable changes.
How can I do the same in Squeak?
I started to
Field>>score: aNumber
score := aNumber. self changed
BreakOut>>initializeToStandAlone
... self field addDependent: self
BreakOut>>udpate
Transcript show: 'Breakout update' ; cr
But I got nothing.
I checked a bit and I was surprised to see that dependents are still managed in Squeak via the DependentFields. I read in old VW tutorials and books that this way of doing things was bad because all the dependents were stored in the same dict. I checked and Model is there :) But Morph does not implement a different ways of storing dependents.
Then I checked
Morph>>changed "Report that the area occupied by this morph should be redrawn." ^fullBounds ifNil:[self invalidRect: self outerBounds] ifNotNil:[self invalidRect: fullBounds]
And realized that Morph was simply breaking the dependency protocol.....(no comment)
So here is my question: - how do we get notification and registration in Squeak for a morph?
Stef
PS: The dependencies mechanism start to be old and broadcasting too much. Is there somebody thinking about a new architecture? Events or DependencyTransformer like in VW ....
Dr. Stéphane DUCASSE (ducasse@iam.unibe.ch) http://www.iam.unibe.ch/~ducasse/ "if you knew today was your last day on earth, what would you do different? ... especially if, by doing something different, today might not be your last day on earth" Calvin&Hobbes
Hi Stef,
I think that the problem is here:
BreakOut>>udpate Transcript show: 'Breakout update' ; cr
it must be:
BreakOut>>udpate: aParameter Transcript show: 'Breakout update' ; show: aParameter; cr
The #changed: method is supposed to pass a parameter telling which aspect of the object had changed. so here, the code must be:
Field>>score: aNumber score := aNumber. self changed: #score
Hoping that helps,
Diego Gomez Deck
Hi
I'm building a breakOut for my book and I have the following problem.
I have one object that contains the score of the game that get increased each time a brick is destroyed.
Now I copied a bit the code of the SameGame to get a list of button around my game field and in particular I want to display the score. So here is my question.
In VisualWorks I would changed the Field score instance variable into a value holder and I will initialize the BreakOut class to get notify whether the score variable changes.
How can I do the same in Squeak?
I started to
Field>>score: aNumber
score := aNumber. self changed
BreakOut>>initializeToStandAlone
... self field addDependent: self
BreakOut>>udpate
Transcript show: 'Breakout update' ; cr
But I got nothing.
I checked a bit and I was surprised to see that dependents are still managed in Squeak via the DependentFields. I read in old VW tutorials and books that this way of doing things was bad because all the dependents were stored in the same dict. I checked and Model is there :) But Morph does not implement a different ways of storing dependents.
Then I checked
Morph>>changed "Report that the area occupied by this morph should be redrawn." ^fullBounds ifNil:[self invalidRect: self outerBounds] ifNotNil:[self invalidRect: fullBounds]
And realized that Morph was simply breaking the dependency protocol.....(no comment)
So here is my question: - how do we get notification and registration in Squeak for a morph?
Stef
PS: The dependencies mechanism start to be old and broadcasting too much. Is there somebody thinking about a new architecture? Events or DependencyTransformer like in VW ....
Dr. Stéphane DUCASSE (ducasse@iam.unibe.ch) http://www.iam.unibe.ch/~ducasse/ "if you knew today was your last day on earth, what would you do different? ... especially if, by doing something different, today might not be your last day on earth" Calvin&Hobbes
Hi diego
Thanks. I followed my investigation. I saw it after. Still the issue of changed defined this way on Morph keeps me perplex.
Stef
On lundi, juillet 29, 2002, at 10:37 PM, Diego Gomez Deck wrote:
Hi Stef,
I think that the problem is here:
BreakOut>>udpate Transcript show: 'Breakout update' ; cr
it must be:
BreakOut>>udpate: aParameter Transcript show: 'Breakout update' ; show: aParameter; cr
The #changed: method is supposed to pass a parameter telling which aspect of the object had changed. so here, the code must be:
Field>>score: aNumber score := aNumber. self changed: #score
Hoping that helps,
Diego Gomez Deck
Hi
I'm building a breakOut for my book and I have the following problem.
I have one object that contains the score of the game that get increased each time a brick is destroyed.
Now I copied a bit the code of the SameGame to get a list of button around my game field and in particular I want to display the score. So here is my question.
In VisualWorks I would changed the Field score instance variable into a value holder and I will initialize the BreakOut class to get notify whether the score variable changes.
How can I do the same in Squeak?
I started to
Field>>score: aNumber
score := aNumber. self changed
BreakOut>>initializeToStandAlone
... self field addDependent: self
BreakOut>>udpate
Transcript show: 'Breakout update' ; cr
But I got nothing.
I checked a bit and I was surprised to see that dependents are still managed in Squeak via the DependentFields. I read in old VW tutorials and books that this way of doing things was bad because all the dependents were stored in the same dict. I checked and Model is there :) But Morph does not implement a different ways of storing dependents.
Then I checked
Morph>>changed "Report that the area occupied by this morph should be redrawn." ^fullBounds ifNil:[self invalidRect: self outerBounds] ifNotNil:[self invalidRect: fullBounds]
And realized that Morph was simply breaking the dependency protocol.....(no comment)
So here is my question: - how do we get notification and registration in Squeak for a morph?
Stef
PS: The dependencies mechanism start to be old and broadcasting too much. Is there somebody thinking about a new architecture? Events or DependencyTransformer like in VW ....
Dr. Stéphane DUCASSE (ducasse@iam.unibe.ch) http://www.iam.unibe.ch/~ducasse/ "if you knew today was your last day on earth, what would you do different? ... especially if, by doing something different, today might not be your last day on earth" Calvin&Hobbes
Hi guys,
I created a screenshot to use for publicity for 3.2 release.
See it at http://minnow.cc.gatech.edu/squeak/683 and http://minnow.cc.gatech.edu/squeak/uploads/683/squeak32.jpeg
Comments?
Diego Gomez Deck
Diego Gomez Deck wrote:
Hi guys,
I created a screenshot to use for publicity for 3.2 release.
See it at http://minnow.cc.gatech.edu/squeak/683 and http://minnow.cc.gatech.edu/squeak/uploads/683/squeak32.jpeg
Comments?
technical: maybe it is better to use a non-lossy format like png (jpeg shows its artifacts).
Maybe some etoy-stuff, but it is already filled up ...
cheers,
felix
Diego Gomez Deck
I think it's too much. It's trying to capture too many groups who aren't very much alike at all. Why not split it out into categories?
Try:
Squeak for kids Squeak for programmers (could be split out into gaming programmers, server/client programmers, etc.) Squeak for multimedia Squeak for ???
The idea of categories makes me feel that Squeak can meet my needs as XXXX. We know that Squeak in all its forms is still Squeak. But that may be too much for a newbie to wrap his/her mind around.
=jason
On Mon, 2002-07-29 at 17:29, Diego Gomez Deck wrote:
Hi guys,
I created a screenshot to use for publicity for 3.2 release.
See it at http://minnow.cc.gatech.edu/squeak/683 and http://minnow.cc.gatech.edu/squeak/uploads/683/squeak32.jpeg
Comments?
Diego Gomez Deck
I think it's okay to have a all-in-one screenshot like that at the beginning of the screenshots page. It gives you a superficial feel for what a bunch of things look like in Squeak, which is okay.
But there are "categories" on the swiki screenshots page (General, Applications, Platforms, etc.), too. If you wanted to split some of these up into finer categories (for kids, programmers, multimedia, etc.), that might make some sense.
- Doug Way Detroit, MI
Jason Rogers wrote:
I think it's too much. It's trying to capture too many groups who aren't very much alike at all. Why not split it out into categories?
Try:
Squeak for kids Squeak for programmers (could be split out into gaming programmers, server/client programmers, etc.) Squeak for multimedia Squeak for ???
The idea of categories makes me feel that Squeak can meet my needs as XXXX. We know that Squeak in all its forms is still Squeak. But that may be too much for a newbie to wrap his/her mind around.
=jason
On Mon, 2002-07-29 at 17:29, Diego Gomez Deck wrote:
Hi guys,
I created a screenshot to use for publicity for 3.2 release.
See it at http://minnow.cc.gatech.edu/squeak/683 and http://minnow.cc.gatech.edu/squeak/uploads/683/squeak32.jpeg
Comments?
Diego Gomez Deck
Hi,
I added an etoy script for our famous car and created a png version.
Any other idea?
(I have no the time today to create different screenshot for different targets)
Diego Gomez Deck
Hi guys,
I created a screenshot to use for publicity for 3.2 release.
See it at http://minnow.cc.gatech.edu/squeak/683 and http://minnow.cc.gatech.edu/squeak/uploads/683/squeak32.jpeg
Comments?
Diego Gomez Deck
On Monday 29 July 2002 01:27 pm, Stephane Ducasse wrote:
PS: The dependencies mechanism start to be old and broadcasting too much. Is there somebody thinking about a new architecture? Events or DependencyTransformer like in VW ....
see classes EventMessageSet, EventModel, "events" protocol in Object.
I believe the only user of this right now is the World (or is it the Project) that broadcasts #aboutToLeaveWorld, etc. upon entry.
squeak-dev@lists.squeakfoundation.org