How do I spawn actors with increasing speed without spawning them at the same time?

vikingviking Member, PRO Posts: 322
edited July 2012 in Working with GS (Mac)
I have actors spawning in all four corners of the screen at ever increasing speeds, but I have to find a way to make sure that I never spawn two or more actors at the exact same time. The player has to move around the screen to collect the actors, so it will feel really unfair and frustrating for the player if two or more actors are spawned at the same time making it impossible to collect every actor.

Any suggestions?

-E

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    @viking

    on spawner add 2 attributes:
    spawnCount … index type … set = 1
    spawnTime … real type … set at higher # to start slow (ex: 3)

    1. Rule: when
    Attribute: self.spawnCount < 5
    -Rule: when (nested in behavior area)
    -Attribute: self.spawnCount = 1
    --Spawn with the correct corner location
    --Otherwise: rules for 2; 3; 4 corner spawns
    then after those rules add the behavior
    -Interpolate: self.spawnCount To: self.spawnCount+1
    Duration: self.spawnTime

    2. Rule: when
    Attribute: self.spawnCount ≥5
    -changeAttribute: self.spawnTime To: self.spawnTime-0.05 (or higher)
    -changeAttribute: self.spawnCount To: 1

    ==
    of course you can use a table to store positionValues for the spawned actors
    or add an attribute for random# location of spawn

    image MH

Answers

  • vikingviking Member, PRO Posts: 322
    Thanks guys :) I think both of these approaches will work perfectly. I will give it a shot!
Sign In or Register to comment.