Keeping actor on textured ground
butterbean
Member Posts: 4,315
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!
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
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.
Also, if you come accross this post Nulo, is this how you did it with your platformer game?
Thanks Codemonkey!
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).