How do I Stop a Timer

Get help using Construct 2

Post » Wed Jul 06, 2016 7:43 am

Hi everyone.
I have a global variable Timer=35.
on start of layout timer goes from 35 to 0 .
I have 2 object (Object A & object B)

What am having problem to do is stopping the timer on its current second
when object A overlaps Object B.
Anyone can help me plz
B
3
Posts: 3
Reputation: 181

Post » Wed Jul 06, 2016 8:54 am

This is a simple version where a variable is set if the object is overlapping.

Image

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Wed Jul 06, 2016 10:04 am

Hey bro many thanks to you.It was really helpful.I made a small test with your codes and it works :)

Btw it there a way so that after Object A overlaps with object B the timer stays on its current time.

In my case the problem am having now is that when the objects overlaps the timer is freeze,thats good,but then they finished overlapping the timer resumes ticking.I want the timer to freeze even after they finish overlapping.

How can i do that?
B
3
Posts: 3
Reputation: 181

Post » Wed Jul 06, 2016 12:43 pm

Remove the "Sprite is not overlapping Sprite2" event.
This way, on the first time both objects overlap, you end up with gRunning set to 0, rendering the first event untrue and preventing from executing it.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,311
Reputation: 71,086


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests