Angle based bounce

Blitz3D Forums/Blitz3D Programming/Angle based bounce

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for the quick response, but it didn't seem to work, let me elaborate a little, my ball object is being moved by:

MoveEntity balls(1)\obj,0,0,balls(1)\speed

then all I have to do to change its direction is to use:

TurnEntity balls(1)\obj,0,newAngle,0

I then check for collisions using:

Collisions SPHERE, POLY,2,2
CountColl = CountCollisions(balls(1)\obj)
If CountColl<>0 Then
For f=1 To countColl
If EntityCollided(balls(1)\obj,ground) Then
TurnEntity balls(1)\obj,0,bouncedAngle,0
End If
Next
End If

Its the bouncedAngle that I cannot get right.