pierski
New member
I believe the problem I am trying to overcome is unique to the Scrolling Platform module.
When jumping on a monster, the following code on line 121 of doHandleObjectCollisions_PlatformerBase.asm is never called, because it is looking for a weapon collision with a monster.
What is called is the code on line 179, which occurs when the player has collided with the monster.
That in turn calls hurtPlayer_PlatformBase.asm with the following code:
I am trying to add a death animation for the monster before the "DestroyObject" on line 21 (commenting out this line causes the monster to not be destroy), but I am not having luck. Any attempt to do "StopMoving" is having no affect on the monster and "ChangeActionStep" causes the animation to run at an extremely slow speed, even when the animation speed for that Action Step is set to 0. I can "PlaySound" without any trouble, but that's about it.
As I said before, I believe this situation may be unique to the Scrolling Platform module as it is a Player/Monster collision and not a Weapon/Monster collision. Any help is greatly appreciated.
When jumping on a monster, the following code on line 121 of doHandleObjectCollisions_PlatformerBase.asm is never called, because it is looking for a weapon collision with a monster.
Code:
JSR doHandleHurtMonster
What is called is the code on line 179, which occurs when the player has collided with the monster.
Code:
JSR doHandleHurtPlayer
That in turn calls hurtPlayer_PlatformBase.asm with the following code:
Code:
;;;;;;;;;;;;;;;;;; Presumes there is a variable called myLives defined in user variables.
;;;;;;;;;;;;;;;;;; You could also create your own variable for this.
LDA gameHandler
AND #%10000000
BEQ +canHurtPlayer
JMP +skipHurt
+canHurtPlayer:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; is the monster below our feet?
;;;;;;;;;; and are we moving downward?
LDA Object_v_speed_hi,x
BEQ +doHurtPlayer ;; equal to zero
BMI +doHurtPlayer ;; or negative
;; here we are moving downward.
TXA
PHA
LDX otherObject
DestroyObject
CountObjects #%00001000
BNE +notZeroCount
LDA scrollByte
ORA #%00000010
STA scrollByte
;;; if there are no more monsters left, we want to disable
;;; the edge check for scrolling.
LDA ScreenFlags00
AND #%11101111
STA ScreenFlags00
+notZeroCount
PLA
TAX
;; Do a hop
LDA #$FC
STA Object_v_speed_hi,x
JMP +skipHurt
+doHurtPlayer
Dec myLives
LDA myLives
BNE myLivesNotZero
JMP RESET ;; game over.
;;;; also could warp to game over screen here instead.
myLivesNotZero:
LDA continueMap
STA warpMap
LDA continueX
STA newX
LDA continueY
STA newY
LDA continueScreen
STA warpToScreen
STA camScreen
WarpToScreen warpToMap, warpToScreen, #$02
+skipHurt
I am trying to add a death animation for the monster before the "DestroyObject" on line 21 (commenting out this line causes the monster to not be destroy), but I am not having luck. Any attempt to do "StopMoving" is having no affect on the monster and "ChangeActionStep" causes the animation to run at an extremely slow speed, even when the animation speed for that Action Step is set to 0. I can "PlaySound" without any trouble, but that's about it.
As I said before, I believe this situation may be unique to the Scrolling Platform module as it is a Player/Monster collision and not a Weapon/Monster collision. Any help is greatly appreciated.