Random Time

Get help using Construct 2

Post » Sat Feb 13, 2016 6:12 pm

Hi

How can I get a random = System > Every 2 seconds

If I want Every 1-2 seconds


Regards
Flemming
B
28
S
15
G
10
Posts: 338
Reputation: 7,837

Post » Sat Feb 13, 2016 6:18 pm

set global variable (time)
if time = 1 do event
if time =2 do event

everytick set time random (1,2)
B
29
S
13
G
10
Posts: 355
Reputation: 8,312

Post » Sat Feb 13, 2016 7:26 pm

timer behavior on the instance that wants to use that behavior


- start timer "random_repeat" for random(1, 2) seconds

- on timer "random_repeat": do actions; start timer "random_repeat" for random(1, 2) seconds




to stop it:
- stop timer "random_repeat"
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 » Sat Feb 13, 2016 8:08 pm

Every choose(1,2) seconds

Sometimes it waits 1s, sometimes it waits 2s
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,209


Return to How do I....?

Who is online

Users browsing this forum: Aergo, AllanR, anty21ro, Ethan, Fenix18, Iftikhar555 and 12 guests