Helping my nephew with collision detection
John Steinmetz
johns
Fri Apr 18 14:54:25 PDT 2003
One way is to have the ball look for a color ("color sees" or "color
under"). When the ball sees the color of the wall, it can execute a
command such as changing its heading. (A fun puzzle is to figure out
how to change the heading so that the ball bounces off at a realistic
angle.)
The advanced stages of the "drive a car" project use color sensing to
keep the car on the road automatically.
John
>Hi All,
> I'm helping my nephew (13) get started writing a game in
>Squeak (trying to move him more into the joy of writing games rather
>than playing games) and he has made some great strides but has a
>problem he can't get through. I'd like to help him but at this point
>the extent of my wisdom is pointing him at Squeak. If any of you
>could give us a hint about how to proceed we'd both greatly
>appreciate it.
>
> Starting from the "make a car" tutorial Byron has now made a
>tank and a steering wheel and some balls that he wants to bounce
>back and forth between two walls. He's quite exceited about the cool
>games he could create trying to drive the tank through a field where
>these bullets are bouncing back and forth and he has discovered that
>he needs collision detection But we haven't been able to implement
>it yet. Currently he has his balls (bullets) bouncing backand forth
>from the top and bottom of the Squeak world but we can't get them to
>bounce off the walls he has made.
>
> I've told him that I think Squeak has collision detection but
>it is a little beyond me to actually show him how. It seems like we
>want to write a test where the ball decides if it is touching a
>wall. We see "touches" but we can't get it to allow us to say
>touches the wall.
>
>
> If any of you can help us we'd appreciate it. Thanks.
>
>Randy and Byron.
--
More information about the Squeakland
mailing list