The enemies in my game wont die, can someone help?
Really nice game, @Arexcl ! I really like the look of the game, and I think you nailed the ambiance. It feels terrifying.
I started the debugger to see why your enemy health did not seem to change. You can see part of my session in the clip below.
It seems like your event handler is not running, since the breakpoint that I set (the red circle next to one of the blocks in the workspace) never hits. If it did, the simulator would pause and I would be able to see information in the debugger.
I have some guesses as to why, but I have not dug deeply into this one yet. My guess is that, because you are in a forever
loop where you manage the animation, the overlap events do not fire. I can try to look at this one a bit more closely after I get back from the office, but that’s my initial guess.
Hi @Arexcl,
It seems that when sprites are set relative to camera, like you here do with the Weapon sprite so that it is always in the correct relative position to the TorchSprite sprite, they are also set to Ghost mode, i.e. no hitbox.
I have updated your code here, where I only have removed relative to camera for the weapon, and instead update its position for every game loop inside an OnGameUpdate block to the same x and y postion as TorchSprite:
This quick n’ dirty solution seems to work well enough to me, but according to this discussion, there is a small nuance between wether to do this before or after the camera updates, which you could control to a finer degree by using the Sprite Utils extension:
I am unsure if this can be solved by other means as well, like reactivating the hitbox periodically or otherwise. That would be a question for a more experienced forum member.