If and whenever Player collide with Boss_TR (Trigger) Boss start moving, cannon was invisible but now it’s visible, turret was invisible now we set that to Visible, Turret was disabled now it’s set to Enabled, setting target for turret the Boss, here reset player health to full, our her1o cannot escape Boss therefore we created Door at position 1568, 260.
We are making sure if Boss is ACTIVE if Boss is ACTIVE, we set Boss to fire some kind of weapon, in our case it is Boss_Fireballs, we need to have boss spawn this weapon every 0.08 seconds. The weapon fired by a boss is set towards player where player x and y. we also instruct Construct 2 to choose the speed of weapon 60, 80, 120, 40, also set acceleration same
I don’t think needs any explanation, clarification.
For next code, we need to add Global Variable PlayergetHitBy_BossFireball, add this in Global Event Sheet
Every time player gets hit by Boss_Fireballs we add 1 to PlayergetHitBy_BossFireball, and destroy Boss_Fireballs, and spawn explosion.
In above lines of code we are counting how many times hero been hit by Boss weapon, if it is 50 times or above, we subtract 1 from player health. Hero produces little blood.
Soon as the cannon is activated it will start firing towards the Boss.
Boss is dead player wins.
Easy to understand;