Monday, March 3, 2008

Fixing the movement

Untill today the main character bassed it's movement on an invisible wheel made using the physics engine. When you pressed left or right keys, the wheel accelerates and the movement of the character looked very weird (he was too fast, it wasn't normal for a person to accelerate more and more while moving, you couldn't stand on slopes (the wheel just sliped down)...)

I've been all afternoon trying to change this "playing" with the wheel options: angular velocity, speed, mass, elasticity, friction... but I only got an even weirder movement.

I tried changing the wheel for a circle. When you press left or right keys, it moves 3 pixels. Gravity and bouncy blocks work right and now you can go uphill and stay on the slopes. I didn't think I'd fix so many things with just a small change.

I've also decided to let the player change the direction of the character mid-air, like in a lot of other platform games.