Oh, i have a projectile that can destroy multiple monsters.
If you have a separate gameobject for your stronger projectile, you can do it like this:
i changed a part in the ProjectSettings - SubRoutines in the script Handle Object Collissions
Look for this part of the script:
You can add the piece of code between
"LDX selfobject" and "DestroyObject"
My stronger gameobject projectile is gameObject #12, you can change that number in the code below.
Code:
BEQ +skipCollision
TXA
STA otherObject
;; There was a collision between a monster and a weapon.
;; weapon is self.
;; monster is other.
;;;;DestroyObject
;ChangeActionStep otherObject, #$07
JSR doHandleHurtMonster ;;;;here the monster gets destroyed, in diffrent ways depending on
;;;if your game has monsters with health or monster-death-animations..
LDX selfObject
;;;;;;;;;;;;;;;;;;Added code so that this playerprojectile continues through multiple monsters
LDA Object_type,x
CMP #12 ;;;<!!--Here you set the number of your stronger projectile gameobject.
BNE +notStrongProj
JMP +done ;;;if it is, skip destroying the projectile, and jmp to end of script
+notStrongProj:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DestroyObject
JMP +done
+skipCollision
When this script runs, and the projectile collides with the monster. the monster gets destroyed and IF it is the strong projectile, it just continues through the monster.
If you have monsters with different health, this projectile will kill them in one shot! Because the projectile doesent get destroyed and continues hurting the monster for every frame that it passes through it.