Spawn an actor when one reaches a point on the stage. Please Help!

KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
edited February 2012 in Working with GS (Mac)
Hello All,
So basically I am creating a distance game. Right now to spawn a random actor I am using a timer so after a set amount of time spawn an actor at random. What I want to do is once the current actor on stage, it's Y reaches, say 150 to spawn a new random actor or to start the timer which will spawn a random actor. Hopefully what I am trying to get help with makes since. Thanks in advance!

Thanks,
killerpenguins

Comments

  • POMPOM Member Posts: 2,599
    You can make a game attribute - boolean - and call it "spawn actor now"
    Now when your actor reaches Y > 150
    Change "game.spawn actor now" TO true .

    Now in your spawner actor have a rule
    When "game.spawn actor now" IS true
    - spawn actor
    - change "game.spawn actor now" To false (to reset the process) .

    Hope it helps you .

    Roy.
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    That didn't work P-O-M. Please if anyone has other suggestions please help.

    Thanks,
    killerpenguins
  • MotherHooseMotherHoose Member Posts: 2,456
    why spawn the first actor?

    have actor off-screen with:
    Rule: when
    Attribute: self.Time ≥ 1
    changeAttribute: self.Position.X To: random(min,max)
    changeAttribute: self.Position.Y To: random(min,max)

    Rule: when (Any)
    Attribute: self.Position.Y ≥ 150
    Attribute: self.Position.Y ≤ 30
    --Spawn with Direction: random(0,359) relative to scene/actor
    --and random for Up and Left relative to Scene

    all the actors should spawn a newActor one time

    @};- MH
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    @MotherHoose - I use that a lot. :)
Sign In or Register to comment.