Spawn orbs of energy or health of enemies

  • Hello,... good

    basically as the title says, spawn orbs of health or energy when to killing an enemy, and that these are directed to the player or the health bar .. whatever the case ..

    as in the games of god of war, dantes inferno, etc.

    thank you very much to the one who responds .. and even more to the one who post an event sheet

  • What exactly is your question?

    You can add all enemies to a family "Enemies" and all orbs/potions to another family "Items" and do this:

    On Enemies destroyed: Enemies spawn Items

    This will spawn a random item when any enemy is killed.

  • Thank you for the quick response ..

    I do not know if I understand, the idea is that when you kill enemies you release orbs that fill your health or energy as in the god of war

    the points (orbs) can be the same for all enemies, but they must appear in their position after killing them, and go to the player

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would also be good if the number of orbs depends on the size of the enemy

  • You should use a tweening addon (like LiteTween) or manually using lerp and other actions to move the orb between the enemy and the player. Tweening looks better since you can use different curves for the movement acceleration and deceleration.

    For the number of orbs per enemy, that could be implemented by a simple integer variable "orbCount". When the enemy dies, loop "orbCount" times and spawn an orb in every iteration.

    To better organize your game, there should be a distinction between destroying an enemy (the object) and killing an enemy (its hp goes to zero). Sometimes, at the end of the level, you want to destroy all enemies but don't want to "kill" them (e.g you don't want the score to increase after a game over, you don't want them to drop more loot, etc). I'm solving this with my Health addon, check it out.

  • thanks for the guide .. I will try to do this.

      LiteTween I did not know it, right now I'm downloading it ... although I know it's hard for me to do it, since I'm still a beginner ... but I want to do this .. thanks again

  • Also check out the MoveTo plugin. It's a great plugin, easier to learn than LiteTween and can also be used for this task.

  • Ok thank you, I'll take a look ..

    If I can do it, I will publish a new theme to help those who want to do it the same

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