Keeping actor on textured ground

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
This question may apply to Nulo, with his game, but anyone feel free to answer

How do you create a rule for an actor to either walk, or roll/move on the ground, and follow the path that is designed for the "ground" or different platforms in the game.

In other words, when an actor is walking on the ground, or jumps onto a platform, how do you get him "appear" to be standing on the ground like in a mario game or any platformer?

Thank you! Still a newbie here!

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Try the rules:

    If self.Motion.LinearVelocity.X = 0, Change Image to StandingImage.

    If self.Motion.LinearVelocity.X > 0, Animate -> Walking Right Images

    If self.Motion.LinearVelocity.X < 0, Animate -> Walking Left Images

    Also, you could add conditions for each of those rules, if actor collides with instance of floor/platform. i.e. is it touching the ground.
  • butterbeanbutterbean Member Posts: 4,315
    Would I have to add a global game attribute? Or should I be able to go straight in and apply these rules?

    Also, if you come accross this post Nulo, is this how you did it with your platformer game?

    Thanks Codemonkey!
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You don't need a global game attribute because it is all confined within the moving actor.
  • nulonulo Member Posts: 315
    hey there butterbean.
    actually what i did was different, inside my "move rules" i made the animation happen.
    for example, i have "if D Key is pressed, moved right in a certain value", then right below that, i have the move right animation.
    i created a attribute that tells the game if the player is facing right or left. this way it knows what to animate when the player is standing still.
    codemonkeys way looks very clean and effective, just needs to add an extra attribute to tell what "standingimage" should it display (left or right).
  • butterbeanbutterbean Member Posts: 4,315
    How do you tell the actor to stand on the ground or platform? Do you add a bounce attribute?
Sign In or Register to comment.