after n seconds

Get help using Construct 2

Post » Fri Jun 07, 2013 4:51 am

how to make an event on after 10 seconds, for example?
B
16
S
6
G
1
Posts: 46
Reputation: 2,778

Post » Fri Jun 07, 2013 5:24 am

You could use the "Every 10 seconds" condition before your event.
There's also a method where you can have a variable (e.g. TimeElapsed), add dt to "TimeElapsed" every tick, and then have an event happen when TimeElapsed = 10.

Every Tick: Add dt to TimeElapsed
TimeElapsed = 10: Do Something
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Fri Jun 07, 2013 8:20 am

Hi all,

Got a problem with the "Every X seconds" event.

I want to switch from two layouts , say , every 5 seconds.

so on layout 1 , i have a event : Every 5 second -> System : Go to layout 2
and on layout 2                 : Every 5 second -> System : Go to layout 1

Problem is that timers seem to be at same time . Only first Layout stay for 5 second. the second Layout switch back immediately to First one ..


Any idea to have each layout stay for a fixed time ??

Thanks in advance.

Sorry for my poor english.
B
2
Posts: 2
Reputation: 154

Post » Fri Jun 07, 2013 8:37 am

what you can do is a wait after a certain condition is met

on loaded layout1 : System wait 5 seconds -> go to layout2
on loaded layout2 : System wait 5 seconds -> go to layout1
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Fri Jun 07, 2013 9:22 am

Isn't a Wait stopping the layout Ticks loop ?? ( because i have some move in the layout before switching )

B
2
Posts: 2
Reputation: 154

Post » Fri Jun 07, 2013 9:53 am

The wait don't stop the game, it just Wait until doing the actions after itself

+yes, the every X seconds compare the time from the begining
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
43
S
18
G
18
Posts: 2,106
Reputation: 16,436


Return to How do I....?

Who is online

Users browsing this forum: GoblinPortal, MAVERICK, mchulet, NN81, whitephon and 8 guests