Touch and Release

Get help using Construct 2

Post » Mon Mar 02, 2015 1:41 am

I suggested "on touched" cause once it's set to 1 you don't have to set it again. "on is touching" would keep running every tick which isn't necessary. From what he explain he need it to switch set the animation speed to 1 when the button is touch which what "on touched object" will do. The animation doesn't change again until they stop touching. On is touching will keep running as long as it is true and keep setting the speed to 1 even when it already is one.

To stop the inverted event from running every tick add a secondary check to see if the animation is even running should be done. So if they are not touching and the animation frame isn't 0 do this.
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Mon Mar 02, 2015 3:56 am

PhoenixNightly wrote:I suggested "on touched" cause once it's set to 1 you don't have to set it again. "on is touching" would keep running every tick which isn't necessary. From what he explain he need it to switch set the animation speed to 1 when the button is touch which what "on touched object" will do. The animation doesn't change again until they stop touching. On is touching will keep running as long as it is true and keep setting the speed to 1 even when it already is one.

To stop the inverted event from running every tick add a secondary check to see if the animation is even running should be done. So if they are not touching and the animation frame isn't 0 do this.


Of course! I was thinking to fast. Thanks for the correction.
B
11
S
4
G
2
Posts: 116
Reputation: 1,936

Post » Mon Mar 02, 2015 4:12 am

Awesome you all. Thanks for all the help.
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Mon Mar 02, 2015 2:17 pm

got it. thanks all. Learned a few things on the way there as well. awesome.
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Mon Mar 02, 2015 2:40 pm

Trying to take this further. If I am flipping through different frames, when I stop ( release) wondering if I can do .. if frame = x, do this? I tried to do it with setting 1 when it hit frame 2 ( for example) but I'm wanting to do it on the release. any thoughts on this @DetteMan @PhoenixNightly
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Mon Mar 02, 2015 4:09 pm

Can I see a capx or snapshot
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Mon Mar 02, 2015 4:13 pm

So here you can PRESS and hold, the colors will flip through, and on release, stops. Wondering if I can check for a certain frame. As it is now, everytime you hit that frame, 1 point is added ( not good lol)
You do not have the required permissions to view the files attached to this post.
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Mon Mar 02, 2015 5:05 pm

No don't use the 'trigger once' cause it will only run 1 time and not any more after that. Drop the 'Trigger Once' on both. On the 2nd Event make the secondary condition if animation speed is great than 0. Also the 1st event can be 'On Touch Started' right now it will keep running every tick. Now for the third event if you want if they lift there finger on frame 2 then you would make if Animation=2 a subevent of 'Is Not Touching'
Last edited by PhoenixNightly on Mon Mar 02, 2015 5:10 pm, edited 1 time in total.
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Mon Mar 02, 2015 5:09 pm

How about checking weather which frame on release. Any tips on how I can approach this? thx for taking the time @PhoenixNightly
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Mon Mar 02, 2015 5:10 pm

Just move the third event into the second one making it a subevent. So when the 'not touching' event run it will then see if it was on frame 2 when it happen.
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, oddreal and 7 guests