Need help to finish my game :)
mynameisace
Hull, UKMember Posts: 2,484
Alright,
I'm nearing the end of my first game in GS. Just need a little help with randomly picking an enemy actor to spawn.
Basically, I have 5 actors that I want to choose from, lets call them Enemy 1, Enemy 2, Enemy 3, Enemy 4 & Enemy 5.
Every 5 seconds I want GS to randomly spawn one of the enemies and spawn it in a set location. I'm fine with the spawning and the timer, just unsure of the randomness.
Any help would be great. Any help written with a new user in mind would be awesome.
Thanks
Ace
I'm nearing the end of my first game in GS. Just need a little help with randomly picking an enemy actor to spawn.
Basically, I have 5 actors that I want to choose from, lets call them Enemy 1, Enemy 2, Enemy 3, Enemy 4 & Enemy 5.
Every 5 seconds I want GS to randomly spawn one of the enemies and spawn it in a set location. I'm fine with the spawning and the timer, just unsure of the randomness.
Any help would be great. Any help written with a new user in mind would be awesome.
Thanks
Ace
Comments
RULE:
when spawnID == 1 >> spawn Enemy 1
otherwise:
when spawnID == 2 >> spawn Enemy 2
otherwise:
etc...
Ace
Sorry for the retardedness, this is my first game (Y)
Ace
RULE:
when game.spawnID equals 1 then spawn Enemy 1
otherwise:
RULE:
when game.spawnID equals 2 then spawn Enemy 2
otherwise:
etc...
You don't need run to completion checked...since its an every timer and the length of time to execute the sequence is 5 seconds...an eternity on the processor clock.
Run to completion is used to force all behaviors to execute...even if the timer runs out or a behavioral condition changes within the timer.
Thanks a lot buddy!
Ace