On Touch. Move Smoothly (Help!!)

Get help using Construct 2

Post » Sat Feb 22, 2014 3:59 pm

Hello. Im still trying to learn this Construct 2 program. It's going really good so far. Its my second time asking for help making this game. I've done pretty much everything now without help.

My problem is:
First off. lemme explain how it's supposed to function.
I've splitted the screen so that when you press the left side of the screen the character/sprite is supposed to face and move that direction.
Same goes with the right side of the screen.

I got the On touch = Mirror to work so that the character / sprite is facing the right way, when pressed.
I can't seem to figure out the second and final part. How do i make the character / sprite move aswell when the Right/Left side is touched/pressed ??

Its supposed to work like this:
When you hold down your finger on the right side of the screen the character / sprite moves smoothly to the pressed / touched side. Same goes with the other side.

Any ideas how this might be done ? Would be glad to get an example aswell, since im still trying to learn :)
B
11
S
3
Posts: 31
Reputation: 814

Post » Sat Feb 22, 2014 4:43 pm

- Is in touch
- system compare: Touch.X < WindowWidth/2

set sprite.x to: self.x - 2
______________________________

- Is in touch
- system compare: Touch.X > WindowWidth/2

set sprite.x to: self.x + 2
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sat Feb 22, 2014 5:34 pm

Im not quite understanding. Could you explain it more detailed.

I did try what you said but i can't seem to figure out what you mean exactly.
(sorry. bear with me)
B
11
S
3
Posts: 31
Reputation: 814

Post » Sat Feb 22, 2014 5:58 pm

Which part do you not understand?
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sat Feb 22, 2014 6:06 pm

Doc Ai wrote:Which part do you not understand?


Pretty much everything about it.

Will give an example on how the touch = mirror looks like.
Image

How would i apply what he said to that ??
B
11
S
3
Posts: 31
Reputation: 814

Post » Sat Feb 22, 2014 6:35 pm

Here an example example .capx -> https://dl.dropboxusercontent.com/u/26932498/howto/touch_move/touch_move.capx

If you want to use letterbox scale or somethins else, I recommend create some sprite to touch on and use "is touching object".
In your example: is touching 'left touch'/'right touch'.

edit: I changed the .capx to "LayoutWidth" instead of "WindowWidth". Now it also works with any Fullscreen scaling.
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sat Feb 22, 2014 8:09 pm

Thanks zyblade. You saved me lots of time and also you helped me learning more :) really appreciate your time :)
B
11
S
3
Posts: 31
Reputation: 814


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 59 guests