How do I make a time based spawner?

0 favourites
  • 5 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • Hello everyone,

    Got a bit of an issue. I'm trying to make a risk of rain kind of game. In Risk of Rain enemies spawn randomly across your screen but as the game progresses the amount of enemies spawned increases and seems to have a cap on the spawn speed so as not to make your game go haywire with 9000 enemies being spawned after an hour of play.

    So I have a spawner invisible block and the enemy it's trying to spawn but I don't know how to make it spawn time based with a cap on it.

    I hope my question is clear but if not then ask away.

  • I would suggest a conditional spawn.

    1st Condition: #of active enemies < 9000

    2nd Condition: your timer = specific Time

    Action: Create Enemy

  • Well, I'm pretty new to construct 2 still so your instructions are a bit hard for me to follow.

    I can't find the first condition in construct 2. I reckon it's using the system condition but I can't find it.

    The second part about the timer is the most confusing and what troubles me, I can't work it out.

    The screenshot I've added shows what I have at the moment but the speed at which it spawns will at some point reach an impossible speed and the game starts lagging..

    If it's not enough information I'll add the .capx.

    Anyway thanks for commenting

  • To limit the speed you can use the max() function.

    max(5 - (time * 0.01), 2)

    So now the minimum time is 2 seconds

    The condition Ubivis is talking about is "Compare two values", a system condition

    Then on one box you put enemies.count (click the enemy object > count) and on the other the max number of enemies

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you very much, this is exactly what I wanted

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)