How do I stop an action?

Get help using Construct 2

Post » Tue Sep 06, 2016 10:49 pm

Hi...I dont't know if my question is correct or no...I'll try to explain my problem.
The action of creating of a sprite every tot sec. is active from the start of the layout and I want to interrupt that action for a while when I tap on another object. how can I do that?
thanks
B
4
Posts: 10
Reputation: 224

Post » Tue Sep 06, 2016 11:29 pm

1.create a instance variable in object that one you want to tap.. and call it "IsSet" and make it boolean !
2.create a new another event:
on tap object sprite
<sub event>
sprite is set | set sprite false
else | set sprite true
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Wed Sep 07, 2016 12:19 am

Check out my example. :mrgreen:

https://www.dropbox.com/s/qcbbliotl46i2 ... .capx?dl=0

Explanation

1. Every second, a sprite is being generated.
2. When the left mouse button is clicked on any of the sprites, the process stops.
3. When the right mouse button is clicked on any of the sprites, the process continues.

The same conditional procedure will occur when you create another sprite and arrange the button clicks on that sprite.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Wed Sep 07, 2016 2:53 am

Else..
another var. from @Gmoney *.capx

https://drive.google.com/file/d/0B8mc-_ ... sp=sharing

When the left mouse button is clicked on any of the sprites, the process stops.
Last edited by CBelle on Wed Sep 07, 2016 2:59 am, edited 1 time in total.
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Wed Sep 07, 2016 2:56 am

CBelle wrote:OR
another var. from @Gmoney *.capx

https://drive.google.com/file/d/0B8mc-_ ... sp=sharing

When the left mouse button is clicked on any of the sprites, the process stops.


Else.. continues. :mrgreen: (That's a great example, CBelle..!!)
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Wed Sep 07, 2016 12:06 pm

Message: gajina can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Gmoney wrote:Check out my example. :mrgreen:

https://www.dropbox.com/s/qcbbliotl46i2 ... .capx?dl=0

Explanation

1. Every second, a sprite is being generated.
2. When the left mouse button is clicked on any of the sprites, the process stops.
3. When the right mouse button is clicked on any of the sprites, the process continues.

The same conditional procedure will occur when you create another sprite and arrange the button clicks on that sprite.


thanks I used your trik!
B
4
Posts: 10
Reputation: 224

Post » Wed Sep 07, 2016 1:28 pm

You're welcome, gajina. :mrgreen:
B
11
S
6
G
15
Posts: 256
Reputation: 9,207


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, tarek2 and 26 guests