Score with Multiplier

0 favourites
  • 8 posts
  • I'm designing a score system that has a bonus multiplier if you kill enemies within a certain time period. Here's the code I'm using:

    <img src="https://dl.dropboxusercontent.com/u/28104568/Score.PNG" border="0" />

    The issue I'm having is that sometimes enemies are killed at the same time, but it's only registering as 1 enemy. I can't do "on Enemies Destroyed" because each enemy has it's own death animation.

    Any idea why it's doing this?

  • Maybe this will help? It's a tutorial I did a while back on creating a multiplier over time.

    Subscribe to Construct videos now
  • ArcadEd - thanks for the link. It's helpful, but unfortunately doesn't solve my problem. Since multiple instances of Health < 0 on the same tick, it's somehow considering all of those as the same instance and increasing the ComboX by only 1 instead of the appropriate amount.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • UPDATE: I've attempted to change the health <_ 0 to "on destroyed" with a specific sprite instead of a family, and it seems to have worked, but I would then have to re-code every enemy's death to destroy the object and create a "death animation" object on the destroyed object (on top of having lines of code for each enemy's score multiplier).

    This kind of feels like a backwards way of doing this...does anyone have any insight on this?

  • I can't do "on Enemies Destroyed" because each enemy has it's own death animation.

    Why, what is preventing you?

  • vee41 - Hey Vee, the objects aren't destroyed until the end of the animation, so there is a delay on the combo, as well as using a family for this creates a strange result of the comboX variable to increase indefinitely upon killing the first enemy.

  • Hey Vee, the objects aren't destroyed until the end of the animation, so there is a delay on the combo, as well as using a family for this creates a strange result of the comboX variable to increase indefinitely upon killing the first enemy.

    You could get rid of for each and increase comboX with enemies.pickedcount instead of one. I'd probably tie increasing the comboX to the start of death animation too. :)

  • Hey Vee,

    I ended up just adding a enemydeath sprite that contains enemy deaths and using the "on destroyed" trigger for the enemies which seemed to have worked. Here's hoping it won't shoot me in the foot later!

    Thanks for you guys' help!

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