Any simple Bouncing help available?

Blitz3D Forums/Blitz3D Beginners Area/Any simple Bouncing help available?

D_Town_Tony(Posted 2004) [#1]
By simple I mean I don't need a "true" ball bouncing physics code, what I am working on is I need my main character to basically bounce off of a bad guy when they collide, so that he gets knocked back when hurt, what I did right now was set his speed to a negative which works when he's facing the bad guy, but if you get hit from behind you get sucked into him(which is bad) and I'm also wondering if anyone has any tips on finding an angle of bouncing off an object for a pong,block breaking type game?


cermit(Posted 2004) [#2]
This should return you the angle between two objects. Be sure to place all the variables right though or it wont work. Hope it helps.
bounce_angle = ATan2(goodguy_y - badguy_y, goodguy_x - badguy_x)