[Squeakland] Bouncing?

Bob Irving irvingb at e-lcds.org
Fri Jan 5 16:00:50 PST 2007

Hi all,
I've been doing some searching on this topic and haven't been able to find answers to my questions. So....
I'm trying to use the bounce command in games (like Pong). Can anyone explain to me *
1. Does bounce require a playfield to bounce off? I've tried testing to see if a ball's color see the color of a wall, and then bouncing if it does. But that doesn't seem to work. I know the ball's color can see the wall's color, because I've also had it croak if it sees the wall. The ball croaks and keeps on going through the wall.
2. Exactly how is the bounce calculated? When I put the ball in a playfield, then make a colored box the same size as the playfield, it will bounce and most of the time the bounce is "true". Every so often the bounce is the opposite of what you expect. Does anyone know why this is? Would I be better off to use a variable for the heading and calculate it, thus inducing the correct "bounce"?
I hope these questions are clear.
Thanks in advance,
Bob Irving
Middle School Technology Facilitator
Lancaster Country Day School
Lancaster, PA
Blog: http://cougar.e-lcds.org/wordpress/ 
"In times of change, learners inherit the earth, while the Learned find
themselves equipped to deal with a world that no longer exists."
Eric Hoffer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://squeakland.org/pipermail/squeakland/attachments/20070105/7a63c9b1/attachment.htm

More information about the Squeakland mailing list