spawn different enemies at random intervals?

tollhousestudiotollhousestudio Member Posts: 166
edited November -1 in Working with GS (Mac)
I would like to spawn 1 of 2 enemies at a time, i have the game spawning one enemy just fine but I want it to be random spawning enemy 01 or enemy 02 for example.

How would I achieve this?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    wherever you are spawning enemies, create a attribute (integer) called "randomEnemy".

    add a changeAttribute that sets randomEnemy to this: random(0,1);

    then add a rule:

    if randomEnemy = 0
    spawn actor 01

    otherwise

    if randomEnemy = 1
    spawn actor 02
  • tollhousestudiotollhousestudio Member Posts: 166
    Hey,

    I tried what you said and its not working correctly.

    I did it a few times to double check but it seems to me that it is not randomising the integer.
    It spawns only one of the spawn rules.

    any suggestions to what I'm doing wrong?
  • tollhousestudiotollhousestudio Member Posts: 166
    do I set the Integer to anything or just leave it as '0'?
Sign In or Register to comment.