Breakout ball movement?

Hi guys,
I have a couple ideas for this:
1. The ball has a speed vector. X speed, y speed, and z speed. If these speed values are above zero, the ball travels positively in the direction. If it's a negative value, it moves backwards I.E. left, down, backward).
If the ball hits a wall, it simply inverses the speed, putting a negative value. The only speed value that decreases with object colisions is side to side, I.E, x speed.
Y and Z speed increase and decrease based on ramps. If the ball is traveling up an inclined section of the table, it slows down. If that reaches zero, it begans to excelerate backwards and down. Similarly, if it's on a decline, it does the opposite: accelerates in the direction it's going. However, x speed isn't changed when on an incline of the table.
Second approach, I could use an angle, and one movement speed. And when it hits an object, it simple inverts the angle, I.E. whatever angle the object collided with the ball  +180.
Would any of these system work? Or, what is the best thing I should use?

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Reply via email to