make boos and twomps only killable by hammer?
Posted: Thu Aug 11, 2016 9:48 pm
how do I edit the thwomps and boos so they can only be killed by the hammer projectile?
Forums for SMBX
https://www.smbxgame.com/forums/
Too complicated. Just use onNPCKill and a getIntersecting ID check.PixelPest wrote:I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide
But then wouldn't the Boo or Thwomp already be killed?Enjl wrote:Too complicated. Just use onNPCKill and a getIntersecting ID check.PixelPest wrote:I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide
Uhh no. That would defeat the whole point of onNPCKill if that were the case. onNPCKill runs juuust before the NPC is killed, and you can cancel the kill event to prevent it.PixelPest wrote:But then wouldn't the Boo or Thwomp already be killed?Enjl wrote:Too complicated. Just use onNPCKill and a getIntersecting ID check.PixelPest wrote:I'd suggest using NPC.get() and NPC.getIntersecting() to check for collisions by other NPCs that can harm them (really only shells I think) and then either change their direction or despawn them before they collide
how do I cancel the kill event?Hoeloe wrote:Uhh no. That would defeat the whole point of onNPCKill if that were the case. onNPCKill runs juuust before the NPC is killed, and you can cancel the kill event to prevent it.PixelPest wrote:But then wouldn't the Boo or Thwomp already be killed?Enjl wrote: Too complicated. Just use onNPCKill and a getIntersecting ID check.