Sign in to follow this  
white_waluigi

Player Movement

Recommended Posts

white_waluigi    111

i've got the following Problem:

im making a 2D not Tile-Based game with Collision Lines in all directions and sizes. Now when the Player moves along a 40 degree Line for example, his movment speed decreases dramaticaly, so i set down the Gravity. but then if the player moves in the opposite direction, he flies of the surface.

 

How could i solve thies Problem?

I thought about implementing a System, that, if the player is on a surface, lets him move along the surface, but that caused me a lot of other problems. How do other People solve this kind of Problem?

Share this post


Link to post
Share on other sites
white_waluigi    111

its top down and the gravity is alawys 1m/s, so the player is always falling, but the player gets on the surface by resolving the collision. Movement is 1 m/s right now which means the effect drops by 45 degrees.

Share this post


Link to post
Share on other sites
Inferiarum    739

How do you resolve the collision?

Lets say the player is penetrating a plane.

If you push the player out in direction of the plane normal it should slide down slopes on its own, which is probably not what you want.

If you push the player out vertically, it will stay in position and gravity should also not affect the movement speed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this