Issue with horizontal collision with moving platform
Greetings! Sorry for all the threadspam, but my problems are many!
I have horizontally moving platforms, but the whole platform is also an obstacle that you should collide with as if it were a backdrop.
Movement is fastloop based, the platform is moved forward 1 pixel every loop, and the loop is done 2 times.
In the loop, after the platform is moved, i check for collision with the player. If there is collision, i move the player the same amount of pixels in the same direction.
So it goes
Move platform
check collision, move player
move platform,
check collision, move player
but somehow, the player gets stuck in the platform, one or two pixels. Like the collision doesn't happen until the loop has finished, and only runs on the second run.
Any ideas?