Player kills monster just by touching?

Craigery

Active member
I have the monsters set to Jump On Kills, but if I just walk up to them I kill them too. If I get under a monster it will kill me as intended, but if I just stand still and they touch me they get killed. I have my player and monster bounding boxes set 1 pixel above the lowest pixels as the video instructed. I have watched the Player and Monster sections multiple times to match my settings, so I don't think that I have missed a step (but I've been wrong before). Anyone else encounter this or did I actually just miss something?
 

dale_coop

Moderator
Staff member
It happens because the code thank check if your player is jumping over the monster is not accurate.
It makes a comparaison beteeen the center of bounding box of both objects.
So if your player has a bounding box (even a little) higher then the monster. The script thinks he’s jumping on him. So he kills it.
Try to make modifications in bounding boxes and test.
;)
 
I'm encountering the same problem. Any idea where this is handled in the scripts? Wondering if this can be adjusted and accounted for.
 

WolfMerrik

New member
Convoy_Avenger said:
I'm encountering the same problem. Any idea where this is handled in the scripts? Wondering if this can be adjusted and accounted for.

It is handled in HandleOnjectCollisions_Platform_Simple.as,

Search for jumpOnMonster
 
WolfMerrik said:
Convoy_Avenger said:
I'm encountering the same problem. Any idea where this is handled in the scripts? Wondering if this can be adjusted and accounted for.

It is handled in HandleOnjectCollisions_Platform_Simple.as,

Search for jumpOnMonster

Sweet, that was enough for me to trouble shoot some answers.
For other people that may be looking:

The code was comparing selfCenterY to otherCenterY. If your character was a sprite taller than Other, this would result in your Y always*(Depending on the size of your bounding box, but likely) being taller, even when standing next to each other.

I first tried changing it to selfBottom cmp to otherTop, but this doesn't work because your bottom Y value will always be lower than their top Y value (Duh)

So I landed on this:

Code:
LDA selfCenterY
CMP otherTop
 

torseelos

New member
Related question for version 4.1.0: Are there Jump On Kills still? I can't find them in my Monsteranimation Info:

If not, how do I still achieve the same result?
Thanks
 

stevecrucial

New member
torseelos said:
Related question for version 4.1.0: Are there Jump On Kills still? I can't find them in my Monsteranimation Info:

If not, how do I still achieve the same result?
Thanks

Yes, i'd like to know too. It looks like it's been taken out 4.1.0. How can we re-integrate the logic (and perhaps improve it)?
 

dale_coop

Moderator
Staff member
No, it's not in the modules that comes with the 4.1
It could be doable but would require lot of time, coding, to handle it correctly (I mean that the previous code had some issues with the collision detection).
 

dale_coop

Moderator
Staff member
OK... spent some time (during my lunch time) to bring the "Jump On Kills" back for the platformer Module in 4.1
It's here:
http://nesmakers.com/viewtopic.php?f=3&t=1748
 
Top Bottom