Basically, it depends what do YOU want for your game, yeah
For example... Here a modified script:
The action Step 7 will do a recoil, reverse code (hurt state)... and the action Step 6, will stop the monster (death state).
For example... Here a modified script:
Code:
TXA
STA temp
GetActionStep temp
CMP #$07 ;; we will use action step 7 for hurt.
BNE +
JMP +doSkipHurtingThisObject ;; if he is hurt, he can't be hurt again.
+
CMP #$06 ;; we will use action step 6 for death.
BNE +
JMP +doSkipHurtingThisObject ;; if he is hurt, he can't be hurt again.
+
DEC Object_health,x
LDA Object_health,x
BEQ +dontSkipHurtingThisObject
;; reverse :
TYA
PHA
LDA Object_direction,x
AND #%00000111
CLC
ADC #$04
AND #%00000111
TAY ;; this is the "direction", where
;; 0 = down, counterclockwise, 7=down-left
LDA DirectionTableOrdered,y
ORA FacingTableOrdered,y
STA Object_direction,x
PLA
TAY
ChangeActionStep temp, #$07
LDA #$80
STA Object_action_timer,x
JMP +doSkipHurtingThisObject
+dontSkipHurtingThisObject:
;; maintain x and y positions for dropable location
LDA Object_x_hi,x
STA tempA
LDA Object_y_hi,x
STA tempB
ChangeActionStep temp, #$06
;; stops
LDA #$00
STA Object_h_speed_lo,x
STA Object_h_speed_hi,x
STA Object_v_speed_lo,x
STA Object_v_speed_hi,x
LDA Object_direction,x
AND #%00000111
STA Object_direction,x
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
+doSkipHurtingThisObject
The action Step 7 will do a recoil, reverse code (hurt state)... and the action Step 6, will stop the monster (death state).