[squeakland] Collision detection, only one object detects the collision

Bert Freudenberg bert at freudenbergs.de
Mon Nov 30 18:12:49 EST 2009


On 30.11.2009, at 23:42, Carl Cravens wrote:
> 
> Thanks for all the responses on this.
> 
> Bert Freudenberg wrote:
> 
>> What if the bullet does a "I'm not over the background" test?
>> But yes, in general Etoys is set up not to make things pretty but to
>> allow the principles to be applied directly.
> 
> My nine-year-old likes "pretty".  He wants to write Flash games, but getting the tools set up on Linux to achieve "hello world" seems to be a monumental task. :)
> 
> The bullet needs to detect collisions with four different kinds of things (invader, base shield, bonus saucer, and invader bomb).  In three cases, they're more or less the same thing... some other object with its own collision scripts.  In the case of the shield, that's just a stamp on the background, and I'm using "over color" there.
> 
> I could use "not over background color" but I still have to get the right object to respond to the collision, which means signaling *everything* to check if it's been hit, and not just one "class" of object.  For now, seeing as I've uncovered a bug, I've switched to "over color" detection and that's working fine.  But "foo overlaps with any bar" seems to be the ideal tool for what I'm doing.  (Though I'm getting a hint here that it may not be as efficient as detecting simple color overlaps.)
> 
> This is turning into a much more complicated project than I expected.  That's good... I've learned a lot about Etoys in a short time.  It's been a fun challenge, and I feel pretty prepared for my son's questions.
> 
> Thanks!
> -- 
> Carl D Cravens (raven at phoenyx.net)

I think James Davis summed it up nicely in his recent blog post:

http://dvorakedtech.blogspot.com/2009/11/i-attempt-to-develop-something-with.html

Etoys is not a general-purpose tool for making pretty applications. Squeak (the underlying system) is, and there are really neat products out there made in it. But Etoys focuses on the creation part, and modeling the behavior, not the prettiness of the result.

All the pretty images do is faking a complexity that is not manifest in the model. That's the secret of good game design, but in science it would be called cheating. We tend to use block colors and test for them because it makes the model's parts immediately obvious - no hidden magic. OTOH I'm almost certain that's sufficient to do graphics comparable to the original Space Invaders [*]. And if adults can imagine aliens in those pixel blotches, I'm certain a child can, too ;)

Have fun with your sun :)

- Bert -

[*] http://en.wikipedia.org/wiki/Space_Invaders


More information about the squeakland mailing list