How do I make a weapon deal dmg over time

0 favourites
  • 6 posts
From the Asset Store
Futuristic Weapons Vol 1
$7.20 USD
40% off
Futuristics Weapons Vol 1 includes 8 different weapons, in a total of 216 sounds
  • Hi , i'm looking for help. I'm making a shoot'em up and i want to make a weapon laser like that deal dmg every x sec to ennemies it collides. I tried this imgur.com/a/ybwgb . But it only does that every 1 sec a large amount of dmg is done. Some help pls ?

  • Make something like this. Add a global variable called DOT set it to 0 on start, when you hit the enemy with the laser set the DOT to 1, then add an event that says system.DOT == 1, as action add your DOT damage with a wait system condition, example substract 1 from health wait 1 sec, then repeat as long as you want it to last, and at the end add system.DOT = 0.

  • Thx for your help , I tried something but it still doesn't work : imgur.com/a/nJlli . Need help pls

  • Give me the Capx file, I can make it for you.

  • Scenario 1:

    Laser can only have 1 instance and, is 2 seconds on screen, and not fired for the next 10 seconds.

    First second ...

    Laser is present.

    Overlap is happening.

    Dot is true

    Subtraction happens.

    Second second ....

    Laser is present.

    Overlap is happening.

    Dot is true

    Subtraction happens.

    Third second ....

    Laser is NOT present.

    Overlap is NOT happening.

    Dot is STILL true

    Subtraction happens. BUT there is no laser. So the instance variable dmg for laser does not exist. Zero gets subtracted.

    And so on ....

    Scenario 2:

    Laser is fired at a dragon for less then a second.

    Laser is gone b4 every second (1) can run.

    Scenario3:

    Laser is fired in 2 bursts at the same dragon.

    System is reset at the second burst. The first damage cycle is never completed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, lets see if i can do this myself.

    Given those rules (not necessarily your rules)

    There are different amounts of damage (since you use an instance variable on the laser, that is safe to assume)

    The dragons suffer damage every second during a hit with a laser.

    The dragons suffer damage for a duration 10 seconds and that with intervals of 1 second after the hit. (delayed damage)

    Previous delayed damages keep counting on, and adding up to the total damage done.

    https://www.dropbox.com/s/07q5lc55sqfnv ... .capx?dl=0

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