[Solved]Spawner timing issues

edited February 2012 in Help request
Hey there guys. You have been a great help to us thus far, and I want to thank you all for your support.

I was wondering if I could get a little more assistance... my team is developing a top-down arcade shooter, and we've finally gotten to the best part: designing enemy and bullet choreography. The problem is that I would like to delay the spawning of the bullets; as it were, as soon as enemies are created, their spawners fire. Is there any way to delay the firing of the first wave of bullets?

Comments

  • edited February 2012
    Hi!

    No worries, we're here to help as much as we can. :)

    So have you tried to setup the Spawner.WaveDelay/Spawner.WaveSize config values?

    That should help you define for how long you want to delay the spawning at first and then you can change it by calling orxSpawner_SetWaveDelay() later on (after a timer or when receiving one of the spawner event that tells you a wave has been spawned).
  • edited February 2012
    I see what you're suggesting, but it doesn't seem very efficient or practical on a large scale, at least to me.

    I was looking to see if there was some kind of an "offset" value for firing the first wave, but there doesn't seem to be one. However, I think that (while typing this post) I may have found a solution! I could store an offset timer of my own somewhere in the config, use it to set the timers as necessary, and when the timers are up, change the wave size from 0 to some other number.

    If I change the wave size on a spawner from 0 to another number, do I have to call enable afterwards, or will it automatically start spawning the next frame?
  • edited February 2012
    That solution sounds very similar to mine except that you change the WaveSize and I change the WaveDelay. ;)

    And yes, it'll spawn next time, no need to enable it, it's already enabled, even with a WaveSize of 0.
  • edited February 2012
    Oh, then maybe I misunderstood what you were saying. Either way, for now, I don't think I'll need to mess with this as much for now; after fixing the way my enemies move, some of those timing issues went away. But I'll still probably have to end up coming up with some way to organize all of this stuff in the C code eventually.
Sign In or Register to comment.