Ball deflecting walls like arkanoid or brick game

BlitzMax Forums/BlitzMax Programming/Ball deflecting walls like arkanoid or brick game

jimmyx(Posted 2006) [#1]
id like to make a ball deflect and move around a 800,600 screen.

im using sprite candy how can i do a 2d version but for blitz3d +sprite candy , or just blitz3d if you dont have sprite candy


Grisu(Posted 2006) [#2]
Ahm, I think this is in the wrong forum BMX <-> B3D!

For BMX:
There is a breakout sample that ships with the full version of it.


*(Posted 2006) [#3]
simply reverse the X, Y speeds when the ball hits something and use a sin/cos calculation when it hits the bat to work out the angle it should bounce off.


poopla(Posted 2006) [#4]
Or calculate the cross product between the velocity vector and the collision normal, and use it as the new velocity vector.


Regular K(Posted 2006) [#5]
Dir=360-Dir works for me if your using direction


SSS(Posted 2006) [#6]
@mike, are you sure? A cross product between any two vectors in two dimensional space (which this is) will result in a vector comming out of the page.


poopla(Posted 2006) [#7]
oerp, good call, my bad :)