User Tag List

Results 1 to 4 of 4

Thread: Firing at random intervals

  1. #1
    No Products Registered

    Join Date
    May 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firing at random intervals

    I am working on a top-down wave-based space fighter. I am trying to figure out how to get the current wave of enemies to shoot bullets at the player at random intervals so its not like a volley of bullets at the same time. The problem is there are different enemies on screen at the same time so i cant do something like "every 00-19 -> Unit_Enemy shoot Bullet in direction (down)" any suggestions?

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Firing at random intervals

    Use Alt Values :
    Always set Alt Value Timer to Timer-1

    When Timer = 0 Shoot and Set Alt Value Timer to Random(x)

    PS : Note this Timer counts ticks, not seconds or miliseconds, this is frame-rate dependant.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Firing at random intervals

    Or simply (time denendant):

    -every 0,25s -> Set Alt value A of Enemy to Random(3).

    A=1 -- Shoot, set A=0

    So the greater range of random numbers you choose, the less chance the enemy will shoot.

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Firing at random intervals

    I'd not recommend using the every (time period) condition because if the game engine slows down because of heavy loading on the CPU then the bullets will still come out at the same rate, meaning not only will people with slow computers have to deal with a choppy frame rate, they will also have more bullets coming at them, which isn't really fair!

    Oh and also, when you set the counter to a random value, probably best to use a random and non random term e.g. 30+random(20) otherwise the enemies can possibly shoot out a whole lump of bullets at once. It's good for gameplay if you let the bullets firing have a little bit of predictability to them, that way the player can time his moves better.

Similar Threads

  1. Random Active Spawn in Random Location in Frame
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2016, 03:33 AM
  2. firing issues
    By pyrothos in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 22nd January 2012, 05:33 AM
  3. Random Speed + Ypos at random times
    By Keehan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th May 2011, 05:25 PM
  4. Tower defense tower firing
    By splicel in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 7th May 2010, 06:34 PM
  5. Guns firing and character walking at the same time
    By Malice in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st October 2009, 03:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •