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

Bert Freudenberg bert at freudenbergs.de
Fri Nov 27 14:13:14 EST 2009


On 27.11.2009, at 06:59, Carl Cravens wrote:
> 
> Hi there!
> 
> I'm a professional developer, and recently discovered Etoys while looking for a language/environment suitable for my 9-year-old son to learn to code in.  (These kids raised on Flash games don't seem to want to write programs with boring text-based interfaces.)  Scratch is really cool, but it quickly became too limiting.  Etoys, while a little less inviting than Scratch, has a lot of power hidden under the hood once you manage to find it.  Many thanks to those who have made it happen... I've been having a lot of fun with it.

Great!

> 
> I've been writing a space-invaders clone

Yay! :)

Looks like the "overlaps any" is buggy - there is some offset in the overlap test:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 10041 bytes
Desc: not available
Url : http://lists.squeakland.org/pipermail/squeakland/attachments/20091127/5ff653be/PastedGraphic-1-0001.png
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 7650 bytes
Desc: not available
Url : http://lists.squeakland.org/pipermail/squeakland/attachments/20091127/5ff653be/PastedGraphic-2-0001.png
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-3.png
Type: image/png
Size: 7614 bytes
Desc: not available
Url : http://lists.squeakland.org/pipermail/squeakland/attachments/20091127/5ff653be/PastedGraphic-3-0001.png
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-5.png
Type: image/png
Size: 7401 bytes
Desc: not available
Url : http://lists.squeakland.org/pipermail/squeakland/attachments/20091127/5ff653be/PastedGraphic-5-0001.png
-------------- next part --------------


>  (I can't figure out how to find a handle for the object I've collided with so I can send it a message directly.  That would be useful.)

Indeed, that would be useful. But we don't really have collision detection yet. The canonical way is to do color tests.

> I'm sure I could switch to testing "I'm over color", but I'd like to be able to use more artistic invaders... I don't want them to be a uniform color.  And I could redraw my invaders so that they don't present such a large "opening".  Or I could give the invaders a background color that matches the playfield instead of a transparent background.

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.

> I'm not sure what the standard is for sharing code... I can post the project if looking at it would be helpful.  Just tell me where and how.

You could upload it to the squeakland showcase:

	http://squeakland.org/showcase/

- Bert -



More information about the squeakland mailing list