Simple request/idea: A Frame Ticker

New releases and general discussions.

Post » Mon Mar 10, 2008 1:04 pm

Dunno if it already exists, but a frame ticker would be good.

So you could use it in conditions, eg:

Every 10 frames, offset 3
--- do something

Would mean that, after 3 frames, a 10-frame ticker initiates.

This'd be good for having many instances of the same object. You could do this:

Every 10 frames, offset random(10)
--- do something

All powerups would move at the same rate, but they'd be randomly offset. So you don't get all coins rotating in perfect unison, etc.

And if you could create a function to run in 10 frames' time:

On Start
--- Function: Call 'Something' in 10 frames' time

On 'Something'
--- action
B
4
S
1
G
5
Posts: 48
Reputation: 1,546

Post » Mon Mar 10, 2008 3:13 pm

There's an every X ticks condition in the system object... and the Function object can call a function after a delay (in milliseconds). Generally it's a good idea to use times in milliseconds instead of ticks, because if you have V-Sync on, your game will be ticking at different rates on different computers.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,554


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests