Have a current actor spawn a random actor. Please Help!
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
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
Thanks
killerpenguins
_____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