So the player has various objects colliding on him, and can collide on various things.
Question 1: whats the best way to deal with this so that velocity change effects and knockback occurs correctly. For example, the asteroid is pushing you against the boundary of the wall. While checking the collision of the asteroid, i realize that if the player is trying to move away from the asteroid ( faster than the asteroid moves towards it ) then the asteroid will clip onto the player because the player ACTUALLY can’t move away because a wall is blocking. So i figure i’ll check the collisions with things like walls first. Your velocity drops to 0 because youre colliding a wall, but then an asteroid hits you and pushes you away, into that wall clipping you again. ( this occurs since i’m checking collisions based on where you will be rather than where you are, since if youre already colliding, then its too late ( the asteroid that should be pushing you is already on top of you )
WALL YOU ASTEROID
dx=0 dx=-10 dx=-5, the asteroid won’t hit you since you’ll be 10 pixels left, except you won’t be 10 pixels left thanks to the wall.
You’ll have to recompile for java 1.5.