Make Actor Move Left and Right Automatically with Touch
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
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)
Will the actor change position (left, right) with each touch?
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
You should constrain attribute self.y to the y position
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.
And they don't have to accelerate toward, move will work too.
Actually, acceleration will be better.
Whoa! Like an Ice skater coming towards you....
Thanks @Socks and @machappli! I