Gravity

Billyd1Billyd1 Member Posts: 133
edited November -1 in Working with GS (Mac)
Hi , having trouble with gravity. Could someone give me a quick run through on how to put in in my game.

I want my character to walk on a platform and walk up sloped platforms without looking like its floating in mid-air.

Thanks

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I just put an acceleration behavior in any actor that I want to fall. Set it to angle of 270 and set the speed to whatever feels right for your game.
  • Billyd1Billyd1 Member Posts: 133
    Thanks worked great, but how do I have gravity when I jump and move left/right. The gravity doesn't work when I jump and move.
  • synthesissynthesis Member Posts: 1,693
    put acceleration down as usually...
    but when you press jump...place another acceleration up. Play with the value til you get what you want.

    I think that will work...never tried it...but who knows.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Here's the deal. Someone correct me if I'm wrong. If you use move or change velocity you can only move left, right, up, or down and it doesn't seem to allow combinations of those. So if you jump up (accelerate at 90 to scene) and then hit the right button you will stop jupming up and move straight right.

    I made a jump demo (search shared projects) that shows a way around this. Basically I use acceleration with a timer (like normal) for jumping and for right and left movement I have a rule that says:

    When right is pushed AND
    When self.linear.X is <250

    Accelerate 0 degrees to scene
    Speed 2000

    New Rule

    When left is down AND
    self.linear.X is > -250

    Accelerate 180 to scene
    speed 2000

    This method uses acceleration so it will feel natural when jumping and or falling. But the rules above mean that it will almost instantly reach a speed of 250. This will make it feel like using the move behavior. But again, it will work with jumping and falling where move does not work well.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    There is a how to (how do) about the different movement behaviors.

    http://gamesalad.com/wiki/how_tos:know_which_movement_to_use
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    After looking at that part of the wiki, Am I right in saying that only acceleration works with jumping and falling? That's what my trial and error has shown me.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Pretty much. Though I've been making platform jumping behavior by just changing the linear velocity.Y value with a Change Attribute instead of a very fast acceleration upwards in a timer. And for left and right movement, not using change velocity, nor Move * behaviors.
Sign In or Register to comment.