User Tag List

Results 1 to 5 of 5

Thread: Enemy Shooting Timing Issue

  1. #1
    No Products Registered

    Join Date
    Mar 2019
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enemy Shooting Timing Issue

    Hi Guys!

    Hope a kind soul will be able to solve this riddle:

    An object shoots a projectile at random time intervals. Whilst it works great for one object, when multiple instances of the same object are on screen they all shoot at the exact same time.
    How can I make it so that random time interval is applied independently for each object?

    Cheers!
    -Zgoro

  2. #2
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    129
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    There's a couple different ways to do this, but the easiest way I can think of doing it is like this:

    Line 1 - Give every enemy a random number at the start of the level
    Line 2 - Subtract 1 from the number
    Line 3 - Once the number reaches 0, shoot the object, and then set the number to 60

    This will make every enemy object fire the bullet every 60 seconds, but each one will do it at a different time

    Here's the example:
    random shooting enemies.mfa

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,398
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    I'm know for a fact there are better solutions by setting an ID and running a loop. Yet for what it's worth, a simple solution would be to use a qualifier and use the 'pick one'. Here's a quick mfa to show what I mean.

    Random Shooting.mfa

    Untitled.png

  4. #4
    No Products Registered

    Join Date
    Mar 2019
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much guys! This is why CF2 community rules!

  5. #5
    No Products Registered

    Join Date
    Mar 2019
    Location
    United States
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Marbenx,

    Thanks for solving the Shooting Timing.

Similar Threads

  1. 360 Degree Enemy Shooting Problem
    By Uber_Bob in forum Fusion 2.5
    Replies: 2
    Last Post: 3rd July 2016, 03:03 PM
  2. Collision-counter timing issue
    By Littlemaxy in forum Fusion 2.5
    Replies: 6
    Last Post: 13th October 2015, 10:58 AM
  3. Shooting issue
    By Sealboyno1 in forum The Games Factory 2 - Technical Support
    Replies: 21
    Last Post: 15th June 2011, 02:02 PM
  4. Upload shooting issue
    By FlinkGigitty in forum File Archive
    Replies: 1
    Last Post: 23rd February 2010, 08:52 PM
  5. Shooting animation timing
    By Fralex in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 22nd July 2009, 06:29 PM

Posting Permissions

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