User Tag List

Results 1 to 2 of 2

Thread: Enemy won't shoot for some weird reason

  1. #1
    Clicker Fusion 2.5

    Join Date
    Dec 2019
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enemy won't shoot for some weird reason

    I have code to make my enemy shoot when the player is near but for some reason, it's not working. I used this exact same methood before on another app and it worked there. So, why not here?
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,159
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    A few reasons:

    You were testing the Y value for +5 and -5 - but the enemy is +6 and -6 larger than the player, so that was never true. I changed that to be +10 and -10.

    You had the enemy to only shoot when flag 5 was on, but only 1 enemy has flag 5 - I deleted that and instead of creating all your objects with flags I inserted a "For Each" statement - that will do the same thing, only now you need 2 lines of code instead of long lists.

    I also changed your enemy shooting to a "for each" statement so that it will test the position of every enemy individually and allow only the enemy that is in range to shoot.
    Attached files Attached files

Similar Threads

  1. Help on getting enemy to shoot properly
    By MrSnazzy in forum Fusion 2.5 Free Version
    Replies: 2
    Last Post: 30th June 2019, 06:41 PM
  2. How to make an enemy shoot directly at the player?
    By LemonyLime in forum The Games Factory 2 - Technical Support
    Replies: 18
    Last Post: 8th January 2017, 10:23 PM
  3. enemy 360 shoot!
    By Sevennemesis in forum Fusion 2.5
    Replies: 2
    Last Post: 25th February 2014, 05:03 AM
  4. Animation not playing for some weird Reason
    By Snooley in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 24th February 2009, 02:50 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
  •