How do I make sprite move left and right

Get help using Construct 2

Post » Wed Apr 01, 2015 1:40 pm

How do I make touch control to make sprite move left and right only
B
52
S
17
G
10
Posts: 205
Reputation: 8,348

Post » Wed Apr 01, 2015 1:43 pm

Hi Abdalghani,

Did you try to use the "Custom Movement" behavior ?

You can use it to make go left or right when a key is pressed.
B
16
S
1
Posts: 34
Reputation: 718

Post » Wed Apr 01, 2015 1:46 pm

I wanna do it by touch control
B
52
S
17
G
10
Posts: 205
Reputation: 8,348

Post » Thu Apr 02, 2015 4:43 pm

compare your Sprite.X with Touch.X
if Touch.X < Sprite.X == move left
if Touch.X > Sprite.X == move right
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
61
S
14
G
2
Posts: 286
Reputation: 6,521

Post » Thu Apr 02, 2015 6:06 pm

Use the "Custom Movement" behavior to the sprite and "On Touch objet" == Sprite , "simulate control"
B
42
S
9
G
2
Posts: 111
Reputation: 3,723

Post » Fri Apr 03, 2015 4:35 am

Thank you for helping
B
52
S
17
G
10
Posts: 205
Reputation: 8,348

Post » Fri Apr 03, 2015 12:58 pm

I'd probably use 8 directional movement and then compare the touch.x to the object.x and if it is was not equal have it simulate movement. However in my game I made like this I believe I decided to not want it to go to the dead center of the object so I used two vents to check if it was greater then object.x+32 and a second event to check if it was less then object.x -32 or something along those lines.
B
6
S
1
G
1
Posts: 31
Reputation: 945

Post » Sat Apr 04, 2015 5:46 am

there are many way to make control touch ( left and right) . thanks
B
52
S
17
G
10
Posts: 205
Reputation: 8,348


Post » Sun Apr 05, 2015 4:25 am

Thank you
B
52
S
17
G
10
Posts: 205
Reputation: 8,348

Next

Return to How do I....?

Who is online

Users browsing this forum: Cappu and 5 guests