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 ?
Develop games in your browser. Powerful, performant & highly capable.
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.
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
Second second ....
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 ....
Laser is fired at a dragon for less then a second.
Laser is gone b4 every second (1) can run.
Laser is fired in 2 bursts at the same dragon.
System is reset at the second burst. The first damage cycle is never completed.
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