- Say you move your object Upwards (0-degrees) that would be
move_ip((1, 0)) - or to the right 90-degrees
(0, 1) - then 45-degrees would be
(1, 1). You get my point.
But how would I move it, say 22 degrees? Math wise that would be around (0.5, 0.75) (not exactly accurate, but a float value is my point). Now how do I move_ip my unit to (0.5, 0.75)? You can't, because PyGame only moves in full integers, not floats. So the only solution you have is to make the value bigger, with for example (0.5 * 100, 0.75 * 100) so (50, 75). But this doesn't work because now my block is moving way too far/fast so it ends up jumping "through" walls and other objects. Sure I can just do * 2 or so, but you just end up with a smaller increment of the same "moving too fast" problem.
So how can I move character 10-degrees, but one-ish unit away (not 100 units away). I am using degrees, so a solution like move_degrees(degree=10, distance=1) would also be fine.
replit.com live example PyGame-move-one-unit-in-degrees