Have a current actor spawn a random actor. 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. Say I have 3 actors I want to spawn in at random. Rather than having a a timer which will spawn one of the 3 actors at random for every so many seconds, I want the current random actor which is on the screen to spawn a one of the 3 actors at random once the current actor's X reaches, say 150. Hopefully this is clear enough and Thanks in advance!

Thanks,
killerpenguins

Comments

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Is there anyone who may be able to help me with this?

    Thanks
    killerpenguins
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2012
    Change attribute self.CanSpawn to true
    _____When attribute self.x>=150 and self.CanSpawn=true
    __________change attribute self.spawnnumber to random(1,3)
    _____when attribute self.spawnnumber=1
    __________spawn actor a
    _____when attribute self.spawnnumber=2
    __________spawn actor b
    _____when attribute self.spawnnumber=3
    __________spawn actor c
    _____change attribute self.CanSpawn to false

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.