Platform Physics

VmlwebVmlweb Member Posts: 427
edited November -1 in Working with GS (Mac)
Hey,

I've been working on a game for a few weeks and I've had a lot of trouble with the movement.
I need it to move almost exactly like this video shows but I can't get the right behaviours and numbers for it to work properly.


Anyone know how I could do move left and right?

Thanks,
Vmlweb

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    here's the challenge. if you want your guy to be able to fall and to jump you must use acceleration (up for jump and down for falling - which I would do instead of scene gravity). But when you use acceleration in the vertical direction you can't use move in the horizontal as it cancels out the vertical jumping/falling. However, using acceleration in the right/left can be tough because of issues with momentum - i.e. it often feels slow to respond to direction changes. Here's what I have tried. I was able to get the right left movement feeling pretty normal by using an acceleration behavior with really high speed (1000 - 2000) and then set the maxspeed in the actor settings pretty low (250 or so). So the idea is that the actor will get to top speed very quickly but will then simply carryon at a nice steady pace. If you don't set the max speed the direction changes will be responsive, but the actor will speed out of control. PROBLEM, now when you go to jump or fall the max speed makes your jump too slow and the actor falls like a leaf in the wind. SOLUTION, do what said earlier but DONT set the max speed. Instead put the right accel in a rule that says "When self.linear.X is <250" and wrap the left accel in a rule that says "when self.linear.X is > -250" I have found this to be the best solution.

    I really wish GS had some movement behavior that felt like the current "move behavior" but worked with acceleration - in other words, I wish X movement could be made separate from Y movement.
Sign In or Register to comment.