Touch and Release

Get help using Construct 2

Post » Mon Mar 02, 2015 8:17 pm

worked like a charm. thanks. Guess I really dont know when I can use or combine subevents. awesome tho. thx
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Mon Mar 02, 2015 9:35 pm

Trying to understand this more. I dont think this is quite a touch and release, but a workaround. Based on the image, should this not do the following.

If when you've released the button, and it's not frame 2, destroy the blue image. right?.. but what it's doing is saying, if I am not touching it, destroy it. Unless I am not getting this right. Thoughts?
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 10:50 pm

The 'Trigger Once' is stalking you remember that runs only one time an not anymore during the runtime of the layout until restarted. And for the Event on line 5 isn't working because you made it a subevent of line 4 Event so it won't trigger.

1. "Trigger Once" do just that trigger one time and will NEVER EVER EVER EVER EVER run again until the program is restarted or layout restarted. This is usually used for setting things up or something that absolutely does not have to run again.

2. Get better and knowing when something is a subevent of something else. So Line 4 Event 'If Sprite Animation Frame=2' has a sub-event of 'If Sprite Animation Frame not = 2' will never be true while it is a sub-event of 'if Sprite Animation Frame =2'. what you can just do is right click Sprite Animation = 2 and select the 'Else' Statement and destroy the sprite in there.
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Post » Tue Mar 03, 2015 12:36 am

I think this is what you were wanting. The issue here is 1: unless the trigger 1 is there, when it's on frame 2, it just keeps adding 1 ( stops only when frame is not 2)
2: after the (on start of layout stuff), the blue does not show ( destroyed)

What ya think? What I'd like to do is. you press the btn, the colors change, stop on 2 , 1 point, stop on any other frame, fail.

Hope I'm not being too much of a bug. thx.
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 » Tue Mar 03, 2015 12:57 am

About so the is not touching Sprite 2 doesn't run every tick you add a second condition to check if the animation speed is greater than 0. So this will only execute when both the conditions are true. The Else is red because you made it a subevent of what you want to be the alternative option to Sprite Animation Frame= 2. They are suppose to line up.
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Post » Tue Mar 03, 2015 1:03 am

you can simply add another condition under it sayng else stop playng animation lol
wtf is with guys giving so many wrong responses
B
70
S
20
G
67
Posts: 1,316
Reputation: 42,305

Post » Tue Mar 03, 2015 10:40 am

@PhoenixNightly
From what I experienced, 'Trigger once' command doesn't need to wait until layout restarted again. I use it occasionally in various cases with same result as if it "fire 1x".
ImageImage
B
102
S
46
G
22
Posts: 773
Reputation: 21,595

Post » Tue Mar 03, 2015 1:44 pm

Ah OK my understanding with the manual explanation it would only fire the first time it becomes true.
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Previous

Return to How do I....?

Who is online

Users browsing this forum: HenryPK, NadeemAbbass, plinkie and 9 guests