Poison: html5 timer on several objects.

(Skip the firsts 2 parts for a summary and misc.)

So first, about my random named variable, it seems simply impossible! :unamused:

For your first method, It seems like you only have one source of burning,
I want different poisons to deal damage independently (or additively).
And all my objects are on the screen… but that may change,
howewer the enemies must be able to die even far away from the screen.

The second option still limit me to 1 poison active per poison type,

Also, another “minor” problem, while visual effect on damage isn’t a necessity (passive visual while poisoned), i’m still woried about the timer.
my timer should be 1 second. To have equivalent damage to your poison 1 exemple, that would mean 8 damage.

Exemple: i have 2 enemies with 7 hp.
the 1st one walk over trap at time T +0s,
the poison timer take a step at T +0.1s and enemie 1 die,
the 2nd enemie walk over another trap at T +0.2s,
the poison timer take a step at T+1.1s and enemie 2 die.

While it’s not a big deal, it means that the gameplay is slightly affected by random.
Up to now, I tried my best to avoid such stuff.

Correct me if i’m wrong, but neither suggestion seems viable for what i have in mind. :neutral_face:
I will probably use suggestion 2, because i might aswell go with the simpler way.

I was thinking about stacks of poisons.
each enemies would have a variable per 0.5 sec up to 6 sec.
each 0.5 sec, a timer move whatever damage is in the variable in the lower one (10 damage in 1 sec go to 0.5 sec),
and when the damage go to 0 sec, the damage applies.
When an enemie walk over a trap, he get 8 damage in both 0.5 sec, 1 sec, and 1.5 sec.
more damage can accumulate.
The problem is, 12 variables are needed per enemies for a poison of 6 seconds. I fear for performance.

I still welcome any idea.

by the way, do you think i should “up” this topic :question: Timed events in HTML5
I’d really want to finish this trap but.. I could drop the poison type traps for the moment and come back later.