Wait some ticks

Get help using Construct 2

Post » Fri Nov 04, 2011 4:50 pm

Hello folks!

I'm needing a part of code to make this happen:

condition > Press UP while Wall sliding pose and wait 1 second > do the jumping pose;

And in the system have a feature to work with time, but I mean that's a global time, what I wouldn't not reset it everytime the wallslide pose happen.

So, I can make a variable count, using every tick, increasing his size bigger than 60, then it check as 1 sec?

Doing this way I wanna be certain of how much times "every tick" update by second?

The sample is here:
http://dl.dropbox.com/u/47035927/sandbox/index.html
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,192
Reputation: 18,301

Post » Fri Nov 04, 2011 4:58 pm

If the main thing is to count to one second the easiest way would be to Always add dt (this is a system variable name) to your global var and when it's equal or greater than 1 a second has passed.

dt is the time that has passed between ticks. So in theory if your game runs at 60fps it's going to be: 1/60 = 0.016666, thus on first tick it's the same, then your global variable becomes 0.033, then 0.05, etc. up to 1.Somebody2011-11-04 17:05:31
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Nov 04, 2011 4:58 pm

Have you read the tutorial about the wait action ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Nov 04, 2011 5:06 pm

I couldn't understand much but if i understood correctly all you need is instead of using
System >every tick use
System > every X seconds and set X to 1
B
12
S
2
G
5
Posts: 23
Reputation: 3,320

Post » Fri Nov 04, 2011 5:10 pm

Edited: After brainstorming about it, the challenge was defeated =P

@Somebody, I used another way, but is really nice to see this variable, I'm hopping to have more variables in the help file to learn about. Thanks!
@Kyatric, thanks, your tutorial really helped =)
@Renegade, yes, mixing with your tip it worked.

Click on the sample link, now it's working right with a clear code =PTELLES08082011-11-04 17:29:36
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,192
Reputation: 18,301


Return to How do I....?

Who is online

Users browsing this forum: currypuff, makotto, randomly, Walessio and 27 guests