Stop time

Get help using Construct 2

Post » Sun Oct 20, 2013 9:00 pm

I have an event that does something every .01 seconds. How can i make it so that if a certain condition(player hitting a block) happens, this event stops? Thanks.
B
6
S
1
Posts: 6
Reputation: 503

Post » Sun Oct 20, 2013 9:07 pm

put player hitting a block into the conditions of the 0.01s-event and invert it (rightclick - invert). This way it only happens when the player is not hitting a block. You could also use an global variable to compare if it is active or not.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sun Oct 20, 2013 9:15 pm

So I set it so that the two conditions are:
player on collision with another object: block
every tick

but it wont let me invert the collision one
B
6
S
1
Posts: 6
Reputation: 503

Post » Sun Oct 20, 2013 9:21 pm

Because collision is only triggered once (inverting triggers like this (they have a little green arrow on their symbol) doesn't work). You can only check for overlapping.

So use a varible (global or instance):

player on collision with block: set globalvariable to 1

every tick
global variable not equal 1: actions

and somewhere after this in the event sheet:
set globalvariable to 0mindfaQ2013-10-20 21:25:38
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sun Oct 20, 2013 9:24 pm

It works!!! thank you!!
B
6
S
1
Posts: 6
Reputation: 503


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, MadSpy and 7 guests