image

image

Thursday, October 2, 2014

Indie Day 6 - Getting the Moths Out of the Machine

so i had a problem when occasionally when colliding with a wall, when the character's sprite would change, it would also get stuck in the, and so the object's collision detection mask would over-lap with the wall's detection mask, and so the player object would just not be able to move. 

i had it set so that when a future collision is detected, the player object moves as close to the colliding object in question as possible, and the (in this case hspeed) speed would be set from whatever it was before, to 0. now i have it change to hspeed*0, which what i'm guessing would not only stop current speed, but would also set acceleration to 0, stopping all horizontal movement.


i also went back to make sure all of my collision masks where exactly the same and that the centers of the sprites where in 1:1 alignment. I am seeing a significant drop in issues with being stuck in walls.

No comments:

Post a Comment