Burnable ennemies, fire spread issues

0 favourites
  • 4 posts
From the Asset Store
Magic Series FIRE Sound Pack comes with 600 high-quality sound effects
  • Hi ! I have a problem in my project. Basically, I am creating a system which allow to ennemies to burn.

    What I have done :

    So I had already done a player, that can punch, but his main weapon is a flamethrower. Fire projected is made of particles. When he double jumps, there is also fire particles toward down.

    Then I have made a family named "Fire" with all types of fire particles, and an other family, "Ennemies" with only one kind for now. Thanks to this, when the life instance variable fall down to 0, the ennemy die.

    What I want to do :

    I want to allow each ennemy instance to burn indivudally, when fire touch them, thanks to "Fire" family. Of course, fire have to follow ennemy, and disappear when he dies. The fire also hurt ennemies.

    That seems simple in fact but...

    Where I am stuck :

    In my opinion, all that I have done is correct. But I steel have unsolved bugs that appear sometimes, and I dont know why :

    • Fire can take some time to born, when an instance of "Ennemies" has the burning state on
    • Other times, fire can simply dosn't appear at all. So the ennemy burn and dies, without particles of fire.
    • And the worst... when a instance burn, others can turn to burning state, like if they were linked in a way that i don't understand.

    To do this, I created a instance variable called "is_burning" (0 = false, 1 = true. Don't know why i don't take a boolean). When a kind of "Fire" family particles touch the sprite of the ennemy, the burning state is turn to 1.

    When "is_burning" equal to 1, an instance of "ptc_fire3" (fire particles of a burning ennemy) is created, if there isn't one already. Else, the fire is constantly moved on the burning ennemy. And when a ennemy's life fall down to 0, fire is destroy if he is overlaping it.

    Or it's as I understand it, because that doesn't seem to work.

    Thanks you for helping !

    I will give you the link of the project in comments but too lazy to do it tonight.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, I read again and I saw mistakes, there are probably more than I think. I am not an English speaker. Here is the link to the project: mega.nz

  • "Fixed" project

    This should pick more "safely" the specific instances.

    Be aware though that the collision polygon when using particle is not what you may believe it to be.

    In the screenshot, I was aiming the mouse to the right of the screen, and notice how wide the red dot area (which is the collision area for the particle) actually is.

    That's why even enemies to the left are still caught on fire.

    Instead of using particle object, perhaps you should create your own particles based on sprites with bullet behavior and disappearing over time on their own.

  • Thank you a lot for yout answer. I will try to apply this solution or maybe do fire with an unique animated sprite.

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