Sign in to follow this  
Followers 0
white_waluigi

Player Movement

4 posts in this topic

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?

0

Share this post


Link to post
Share on other sites

You say that you have gravity - is it a top-down view or a side view? How is the gravity affecting your movement?

Can you be a bit more specific on how you currently calculate your movement?

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

i avoided the sliding by adding fraction

 

so your telling me top just resolving the collision vertically or horizontal?

k ill try it out

0

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  
Followers 0