[racket] Doing collision detection in universe.ss

From: Yaron Minsky (yminsky at gmail.com)
Date: Wed Nov 28 07:37:27 EST 2012

To be clear, I'm firmly interested in tinkering, which is why I'm
using universe.ss and image.ss.

I do think that a good design goal for Racket's kid-oriented libraries
would be to be feature compatible with Scratch.  It would be great if
there were good ways of doing everything that Scratch can do, from
playing sounds to detecting collisions, to (more aggressively) on-line
hosting of the final result.  I'd love it if Racket were strictly
better than Scratch for someone who really can figure out how to
program, but it's just not true now.

y

On Wed, Nov 28, 2012 at 7:11 AM, Hendrik Boom <hendrik at topoi.pooq.com> wrote:
> On Tue, Nov 27, 2012 at 08:56:13PM -0500, Yaron Minsky wrote:
>> I've been weaning my son off of Scratch in favor of Racket, and trying
>> to get him to write interactive games using universe.ss and image.ss.
>> I'm wondering if anyone has suggestions for how to do things like
>> collision detection.  image.ss has these nice first-class images, but
>> I don't see a good way of querying two images to see if they overlap.
>>
>> Has anyone else had luck in doing this?  universe has a nice
>> programming model, but I've found it challenging to find simple ways
>> of doing the kinds of things that Scratch makes easy.
>
> There are two arts to collision detection: figuring out whether two
> images collide (which gets trickier when they're in motion) and
> organising all your objects so you don't have to test very many
> combinations of them.
>
> Both of these can get quite complicated, and are susceptible to
> nontrivial, complicated, and often necessary efficiency improvements
> depending on special properties of the game.
>
> A one-size-fits-all solution may be good enough for tinkering with, but
> serious use may well need serious hacking.
>
> -- hendrik
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.