Make Actor Move Left and Right Automatically with Touch

Paul :)Paul :) Member, PRO Posts: 15

Hi, I am completely new to Game Salad. I want to make an actor automatically move left with a touch, then move right with another touch, and move back left and etc. The actor will stay in play in the Y axis, and only move in the X. I also want to add some acceleration, so it's not just a constant movement. I am using a PC, any help will be very much appreciated. Screenshots will help tremendously as I am still pretty new to GS but have a pretty good basic understanding of it. Thanks in advance!

Comments

  • Hideki MatsuiHideki Matsui JapanMember, PRO Posts: 82

    Maybe Accelerate Toward will help you.

    Accelerate Toward:
    Position X: game.Touches.Touch 1.X(in Devices)
    Position Y: (its Position Y)
    Relative to: Scene
    Acceleration: (Up to you)

  • Paul :)Paul :) Member, PRO Posts: 15

    Will the actor change position (left, right) with each touch?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Are you saying that you want the actor to change directions when you click/tap on it? And otherwise the actor will move in the direction it's facing automatically?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • A_ConstantinA_Constantin EnglandMember Posts: 79

    You should constrain attribute self.y to the y position

  • Paul :)Paul :) Member, PRO Posts: 15

    So the actor will start off moving right automatically, and when you touch, he'll go left, touch again, and he'll go right. Y position stays the same.

  • Paul :)Paul :) Member, PRO Posts: 15

    And they don't have to accelerate toward, move will work too.

  • Paul :)Paul :) Member, PRO Posts: 15

    Actually, acceleration will be better.

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @skyflaw@gmail.com said:
    Actually, acceleration will be better.

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393
    edited March 2015

    Whoa! Like an Ice skater coming towards you....

  • Paul :)Paul :) Member, PRO Posts: 15

    Thanks @Socks and @machappli! I

Sign In or Register to comment.