Assistance with left and right movement

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
I'm having trouble with the left and right movement with the multi-touch controls

I created 2 boolean attributes game.moveleft and game.moveright

under the Right touch key:

I placed the rule:

When touch is pressed:
Change game.moveright to true

When touch is released:

Change game.moveright to false

(Same thing for left arrow)

Under my main actor:

When game.moveright is true

Animate:

When self.motionlinearvelocityX <175

Accelerate:
1500

Change attribute: Self.facingleft to false

What happens is, when I let off the right or left key, she won't animate moving, but she slides on the ground like it's slippery ice

How do I make her stop, when I had the keyboard controls, they worked perfect with the other rules in place, and she would stop when you let off the left or right key

Comments

  • butterbeanbutterbean Member Posts: 4,315
    Anyone ? How do I make her stop sliding?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Check out:
    http://gamesalad.com/game/play/23210

    I added an accelerate based movement actor. And a stop rule when moveright and moveleft are both false.
  • butterbeanbutterbean Member Posts: 4,315
    I don't have access to the plug-in right now but thanks for posting up the demo! How do you tell an actor to stop?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You can download the project by saving the linked file at the Download Project button at the bottom right of the game area. Save it and rename it as a .zip and unzip it to look at the project.

    Stop uses the Change Velocity to 0.
Sign In or Register to comment.