I programmed a life counter for a Boss, in that the boss loses 1 life when he collides with "Meteor1", but in rare cases he loses 2 lifes at the same time. I can't find the problem in my code.
Can you give the app aia.
why? Did I not send enough?
Because I wanted to see the properties of the component.
Thank you...I will check
I think some blocks are disabled
which blocks are disabled?
Where are you showing boss life?
Label: Boss_life
I am not facing any problem.
I'am also not finding the Problem in the code, but the bug is still there.
Consider adding a very short grace period when the Boss is invulnerable after being hit.
Set a global variable ms_last_boss_hit to the Clock1.SystemTime of the last time the boss was hit, initially 0.
When the boss has been hit, check if current Clock1.SystemTime() - global ms_last_boss_hit > (your grace period in ms). If so, process the hit and update global ms_last_boss_hit. Otherwise, ignore the hit.