How do I create a touch release

Get help using Construct 2

Post » Tue Mar 31, 2015 6:23 pm

How do I create a touch release

what I want is to create this same but touch:

Image

I tried to invert the function 'is touching' but does not work well

sorry by my bad english i talk spanish.

thanks.
B
4
Posts: 23
Reputation: 246

Post » Tue Mar 31, 2015 6:53 pm

Oh so you are trying to make this same thing but instead of keyboard you wanna do on touch?
B
10
S
2
Posts: 75
Reputation: 764

Post » Tue Mar 31, 2015 7:01 pm

mikewalton206 wrote:Oh so you are trying to make this same thing but instead of keyboard you wanna do on touch?

exactly
B
4
Posts: 23
Reputation: 246

Post » Tue Mar 31, 2015 7:43 pm

If you are making a game where the object has a built in behaviour, there should be a behaviour event which would suit the case better

Or you could use the on touch end functions.

If you have representations of the keys in game you can use a system like:
Image
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Tue Mar 31, 2015 8:01 pm

briggybros wrote:If you are making a game where the object has a built in behaviour, there should be a behaviour event which would suit the case better

Or you could use the on touch end functions.

If you have representations of the keys in game you can use a system like:
Image

i do not understand how I can put that
B
4
Posts: 23
Reputation: 246

Post » Tue Mar 31, 2015 8:16 pm

try this aproach:
use dummy sprite (blank, invisible)
and set it to create on any touch at touch x and y

than set your events something like this:
on touched sprite + if dummy is overlaping that sprite + set that sprite variable from 0 to 1 = key pressed action
and something like this:
on any touch end + sprite has variable 1 + dummy gets destroyed = key released action
and then return sprite variable to 0
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Tue Mar 31, 2015 8:33 pm

irina wrote:try this aproach:
use dummy sprite (blank, invisible)
and set it to create on any touch at touch x and y

than set your events something like this:
on touched sprite + if dummy is overlaping that sprite + set that sprite variable from 0 to 1 = key pressed action
and something like this:
on any touch end + sprite has variable 1 + dummy gets destroyed = key released action
and then return sprite variable to 0


i dont understand

i put this and not work

Image
B
4
Posts: 23
Reputation: 246

Post » Tue Mar 31, 2015 9:04 pm

Start the animation using the object touched event, not the is touching. And use the on touch end to finish, not the 'x is touching'
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Tue Mar 31, 2015 9:32 pm

briggybros wrote:Start the animation using the object touched event, not the is touching. And use the on touch end to finish, not the 'x is touching'

Image

not work
B
4
Posts: 23
Reputation: 246

Post » Wed Apr 01, 2015 5:24 pm

@deth123 you need to do a check to make sure that touch 0 was on the object.
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, Darknessed and 10 guests