ramdom enemies shoot ?

guillefaceguilleface Member Posts: 1,014
edited November -1 in Working with GS (Mac)
say i have 20 enemies on the scene, i want like every 3 seconds only 5 shoot at once, is this possible , i can make it only work but only if all enemies shoot

Comments

  • guillefaceguilleface Member Posts: 1,014
    any ideas guys?
  • Asobu_GamesAsobu_Games PRO Posts: 261
    How about making a game attribute (integer) called something like 'random shoot'. Then attach a 'change attribute' behavior somewhere in your scene (attach to the background or an invisible actor etc) to randomly change this integer attribute. for example every 5 seconds change attribute to a random number between 1 and 3.

    Then make a rule for each enemy like if 'random shoot' attribute # = 1, shoot. So if the random number is 1, all the #1 enemies shoot, if random # = 2 all the #2 enemies shoot.

    You could randomise this even further by randomly assigning the numbers to each enemy when they spawn.

    Hope this makes sense mate :)
Sign In or Register to comment.