im describing a bouncing object which can only move on 4 or 8 directions (will want both versions for my game). want to be able to restrict to say only diagonals, only horizontals, or horizontals AND diagonals.
ive found a few solutions by using 'is object overlapping at offset', so i test whether the bullet it hitting a wall or a floor/ceiling, so the angle can be adjusted appropriately.
(eg. if object is moving at an angle of 45*, if it hits a floor it turns to 315*, if it hits a wall to its right it turns to 135*)
it works for the most part but has occaisional errors where it seems to bounce the wrong way.
so was really looking for the most simple equation or simple method to handle this style of movement
thanks for anyones help with this