How to perform an action with the condition that the touch

Discussion and feedback on Construct 2

Post » Sat Apr 15, 2017 2:53 am

I want to divide my screen into two sections of touch, one half moves to object 1 and the other half moves to object 2. what I can think of is to indicate the dimensions in which I can touch the screen to move objects, but I need to know how Create the condition
B
3
Posts: 5
Reputation: 187

Post » Sat Apr 15, 2017 3:11 am

Assuming you know how to add touch:
Conditions: Is In Touch (or whatever touch trigger you want to use) & Compare two variables (found in system)

Assuming you are splitting the screen length wise:
(left side of screen)
Var 1, you want to use Touch.x
< (switch this for right side of screen)
Var 2, half the margin size
B
16
S
7
G
5
Posts: 30
Reputation: 3,777

Post » Sat Apr 15, 2017 3:14 pm

I do not understand how to add the condition.

I would like someone to send me an example of how.
B
3
Posts: 5
Reputation: 187

Post » Sat Apr 15, 2017 3:54 pm

B
16
S
7
G
5
Posts: 30
Reputation: 3,777

Post » Sat Apr 15, 2017 4:42 pm

You can send me a screenshot please, I would appreciate it very much. What happens is that it gives me error to open your example that you sent me since I have version 227
B
3
Posts: 5
Reputation: 187

Post » Sat Apr 15, 2017 4:52 pm

Here you go, its a large picture so I just put it on dropbox, I don't think you have to download it though.

https://www.dropbox.com/s/mvhi4a7kaliyx ... t.png?dl=0
B
16
S
7
G
5
Posts: 30
Reputation: 3,777

Post » Sat Apr 15, 2017 4:54 pm

Just a reminder the system condition is "Compare Two Variables"
B
16
S
7
G
5
Posts: 30
Reputation: 3,777

Post » Sat Apr 15, 2017 8:27 pm

great!!! I worked. But now I have another problem, my object is solid and I have a solid floor, and when I move it with the touch does not stop on the floor, it looks like q was a sprite without solid state.

Has to do with the touch from what I see, but I do not know how to make it respect the solid state.
B
3
Posts: 5
Reputation: 187

Post » Sat Apr 15, 2017 9:11 pm

I'm trying my best to understand the type of game you're making, my guess is it is a platform. If you can better describe what you want the object to do and the environment it is in that will help me help you.

If it is a platformer; Is this a standard platform game? meaning the floor is at the bottom of the screen.
Are you using any behaviors for the objects?
B
16
S
7
G
5
Posts: 30
Reputation: 3,777

Post » Sun Apr 16, 2017 2:49 pm

What I'm doing is the game Pong, at the ends put some walls so that my rackets do not leave the screen, but with the touch if they manage to leave, does not respect their solid state.
B
3
Posts: 5
Reputation: 187

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 19 guests