Global variable doesn't count but everything else is

0 favourites
  • 4 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hello!

    Top down shooter.

    1. If I shoot enemies very fast Kills+1 sometimes doesn't count if it sits under Health<=0 && Alive==True.

    2. But! It does count properly if it sits above destroy.

    So In first scenario kills would not be equal to spawned enemies sometimes especially when there's many enemies being killed. Animation played no enemies on screen but kills doesn't get +1!

    In second kills always equal to # of spawned enemies.

    Been debuting this with my dev friend and even though we fixed it by moving it to enemy-destroy, I don't know why it didn't work in first place.

    It bugs me, why it didn't work in the first place?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would try adding "For Each Enemy" to both of those conditions, to check if *each* enemy on screen has 0 health or has finished animating.

    (i think you're currently checking if *any* enemy is true, which screws up when two or more enemies are true at the same time)

  • I would try adding "For Each Enemy" to both of those conditions, to check if *each* enemy on screen has 0 health or has finished animating.

    (i think you're currently checking if *any* enemy is true, which screws up when two or more enemies are true at the same time)

    Holy crap you're right!! That's it! Just tested it. Brilliant! Phew, thank you very much!

  • Happy to help! I had the same problem years ago, and someone on this forum gave me the same advice. Gotta pay it forward! Good luck with the game!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)