PDA

View Full Version : Pong game: Script help or reference



chockybickyman
October 3rd, 2004, 10:21 PM
Need help or any links to reference material to make an advanced pong game.

Need the ball to be able to bounce on different angles off the paddle, most examples i have seen out there only bounce on the same axis, which is just too plain and not what im looking for.

Any help, be much appreciated.

Cheers
Peter.D
chockybickyman@hotmail.com

Dr Warm
October 4th, 2004, 02:41 AM
yes most just times the ball direction by -1 but an easy way to get an angle, from the centre of the paddle, is to have something like:
under the hitTest have){
if(pongball._x > paddle._x){
pongballspeed += pongball._x - paddle._x;
} else {
pongballspeed -= paddle._x - pongball._x;
}
}
i think, anyway there's lots of examples of this on flashkit.com, like maybe 100 or so