How do I build around a timer

Get help using Construct 2

Post » Mon Feb 01, 2016 9:58 pm

I have a top-down shooter where enemies are spawned based on time. I've created a timer that counts time since the start of the layout - since game time isn't reliable after you've died or moved levels, etc.

The problem I'm getting is I tell the system to spawn an enemy when the timer = 20. If I set the timer to tick up every one second, then it will spawn like 50 enemies because of the length of time that the scenario is true. If I set the timer to count up by tenths or hundredths of a second, then the system won't even register 20.00 seconds and nothing will spawn. I've messed around with half seconds, quarter seconds, etc. and there doesn't seem to be a sweet spot. I either get a stream of enemies or no spawn.

The odd thing is that if I use game time then it's flawless. I say spawn at 20 seconds and it only spawns one sprite. Also, game time doesn't sync up with any of the timers I've made, it will hit 10 seconds when my timer is at like 6.5, even though they're both counting up in seconds. I feel like I have to be doing something stupid. Please help!
B
6
S
1
Posts: 8
Reputation: 353

Post » Mon Feb 01, 2016 10:00 pm

Use the Timer behaviour. It is a better mechanism for accurate timing.
ImageImageImage
B
71
S
21
G
211
Posts: 3,612
Reputation: 119,143

Post » Sat May 28, 2016 6:15 am

blackhornet wrote:Use the Timer behaviour. It is a better mechanism for accurate timing.


Thanks for the response - I read it, looked it up, and everything I found were things I had already tried. Not to be a complete n00blet but if you or someone else has a minute would you mind explaining the process in detail? I actually scrapped this project for 3 months but I'd really like to finish it.

If it's any help / reminder - I can't use system time because you can't control that. With pause menus, boss fights, etc. -- it's not reliable. I've tried making global timers but it's either too specific (e.g. on a 00:00:00 timer) and it doesn't hang on "00:20:00" long enough for the system to spawn a single enemy OR it's too vague (counting up in just seconds and minutes) and the system will spawn a wall of enemies for the time that the timer = "00:20" If there's a built in timer function, I can't find it :/ I won't be offended if you explain it to me like I'm 5yo.

Many thanks ahead of time (but not too descriptive of time because that would spawn a wall of "thanks"...)
B
6
S
1
Posts: 8
Reputation: 353


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests