LDX player1_object
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; this is for platform game.
;;From dale coop 2 button pressed
;;And add a code at the beginning of the script In input editor with fiest button as held then this checks if other buttons
LDA gamepad
;;AND #%00010000 ;; if UP is pressed
;;AND #%00000001 ;; if A is pressed
AND #%00000010 ;; if B is pressed
BNE +
RTS ;; if not, stop the script
+
;;JMP RESET ;;restet test
STA Object_h_speed_hi,x ;;
StartMoving player1_object, MOVE_LEFT
FaceDirection player1_object, FACE_LEFT
ChangeObjectState #$05, #$02 ;;set player state to dash ie state #$05
PlaySound #sfx_jump
RTS
;; MODIFIED FROM DEFAULT JUMP SCRIPT
;; Get player object
;; Check if in air, and skip if so.
LDX player1_object
LDA Object_status,x
AND #%00000100
BEQ +
LDA gamepad
;CMP #%00100000 ;;check if “down” is press too
CMP #%00000010 ;; if B is pressed
BNE +
;; Check facing direction
LDA Object_movement,x
AND #%00000111 ;only keep the last 3 bits
CMP #%00000010 ;FACE_RIGHT = #%00000010
BEQ slideRight
JMP slideLeft
slideRight:
;FACE_RIGHT = #%00000010
LDA #$00
ADC #$06
STA Object_h_speed_hi,x
JMP continueSliding
slideLeft:
;FACE_LEFT = #%00000110
;; Store 250 in accumulator and assign it to object's speed
LDA #$00
SBC #$06
STA Object_h_speed_hi,x
continueSliding:
ChangeObjectState #$05, #$02 ;Set the object's animation state (my dash action is 7)
;PlaySound #SFX_PLAYER_JUMP
+
RTS
;; MODIFIED FROM DEFAULT JUMP SCRIPT
;; Get player object
;; Check if in air, and skip if so.
;LDX player1_object
;LDA Object_status,x
;AND #%00000100
;BEQ +
LDA gamepad
CMP #%10000000 ;;check if “left” is press too
CMP #%01000000 ;;check if “right” is press too
;CMP #%00100000 ;;check if “down” is press too
;AND #%00000010 ;; if B is pressed
;BNE +
;; Check facing direction
LDA Object_movement,x
AND #%00000111 ;only keep the last 3 bits
CMP #%00000010 ;FACE_RIGHT = #%00000010
BEQ slideRight
JMP slideLeft
slideRight:
;FACE_RIGHT = #%00000010
LDA #$00
ADC #$06
STA Object_h_speed_hi,x
;ChangeObjectState #$05, #$02
JMP continueSliding
slideLeft:
;FACE_LEFT = #%00000110
;; Store 250 in accumulator and assign it to object's speed
LDA #$00
SBC #$06
STA Object_h_speed_hi,x
;ChangeObjectState #$05, #$02
continueSliding:
ChangeObjectState #$05, #$02 ;Set the object's animation state (my dash action is 7)
PlaySound #SND_ALLY_PICKUP
+
RTS
LDA #$00
STA newGameState
LDA warpMap
sta currentMap
clc
ADC #$01
STA temp
GoToScreen warpToScreen, temp, #$02
LDA #$00
STA playerToSpawn
LDX player1_object
DeactivateCurrentObject
LDA #$01
STA loadObjectFlag
LDA mapPosX
STA newX
LDA mapPosY
STA newY
RTS
Yip i feel the same way, like in 1000 spikes, its just a sound jungle and how many lives uv got left between deaths adn even then it seems too long sometimes.Dirk said:If I play a game where I die a lot I personally prefer being able to continue playing as soon as possible. So I think I would leave it out, although it looks good.
You might consider having an option menu at the title screen where you can set if you want to have this screen displayed after death or not. Might be a bit of an overkill though.
LDA #INIT_TRIG_00
STA screenTriggers+0
LDA #INIT_TRIG_01
STA screenTriggers+1
LDA #INIT_TRIG_02
STA screenTriggers+2
LDA #INIT_TRIG_03
STA screenTriggers+3
LDA #INIT_TRIG_04
STA screenTriggers+4
LDA #INIT_TRIG_05
STA screenTriggers+5
LDA #INIT_TRIG_06
STA screenTriggers+6
LDA #INIT_TRIG_07
STA screenTriggers+7
LDA #INIT_TRIG_08
STA screenTriggers+8
LDA #INIT_TRIG_09
STA screenTriggers+9
LDA #INIT_TRIG_0a
STA screenTriggers+10
LDA #INIT_TRIG_0b
STA screenTriggers+11
LDA #INIT_TRIG_0c
STA screenTriggers+12
LDA #INIT_TRIG_0d
STA screenTriggers+13
LDA #INIT_TRIG_0e
STA screenTriggers+14
LDA #INIT_TRIG_0f
STA screenTriggers+15
LDA #INIT_TRIG_10
STA screenTriggers+16
LDA #INIT_TRIG_11
STA screenTriggers+17
LDA #INIT_TRIG_12
STA screenTriggers+18
LDA #INIT_TRIG_13
STA screenTriggers+19
LDA #INIT_TRIG_14
STA screenTriggers+20
LDA #INIT_TRIG_15
STA screenTriggers+21
LDA #INIT_TRIG_16
STA screenTriggers+22
LDA #INIT_TRIG_17
STA screenTriggers+23
LDA #INIT_TRIG_18
STA screenTriggers+24
LDA #INIT_TRIG_19
STA screenTriggers+25
LDA #INIT_TRIG_1a
STA screenTriggers+26
LDA #INIT_TRIG_1b
STA screenTriggers+27
LDA #INIT_TRIG_1c
STA screenTriggers+28
LDA #INIT_TRIG_1d
STA screenTriggers+29
LDA #INIT_TRIG_1e
STA screenTriggers+30
LDA #INIT_TRIG_1f
STA screenTriggers+31
CPX player1_object
BNE +
JSR HandlePlayerDeath
PlaySound #SND_HURT_PLAYER
JSR LoseLife
;;JMP RESET
+
;;; do loss of life stuff here
;; DEC myLives
LDA myScore ;; to read/load the value corresponding to the units
LDA myScore+1 ;; to read/load the value corresponding to the tenths
LDA myScore+2 ;; to read/load the value corresponding to the hundreds
LDA myScore+3 ;; to read/load the value corresponding to the thousands
LDA myScoreSave
STA myScore
LDA myScoreSave+1
STA myScore+1
LDA myScoreSave+2
STA myScore+2
LDA myScoreSave+3
STA myScore+3
SubtractValue #$02, myLives, #$01, #$00 ;;Subtract 1 from the Ones digit
;;AddValue #$02, myLives, #$01, #$00 ;;add 1 from the Ones digit ally
;; first, checking the tenths:
LDA myLives+2
BNE gameNotOver
LDA myLives+1
BNE gameNotOver
;; if the tenth digit is zero, then checking the units:
LDA myLives
BNE gameNotOver
;;do gameover stuff here. Warp to screen? Show animation? Just restart?
JMP RESET
gameNotOver:
;;;;;
;;; do warp to continue screen stuff here.
LDA #$00
STA newGameState
LDA continueMap
clc
ADC #$01
STA temp
GoToScreen continueScreen, temp, #$04
LDA #$00
STA playerToSpawn
; LDX player1_object
; DeactivateCurrentObject
LDA #$01
STA loadObjectFlag
LDA continuePositionX
STA newX
LDA continuePositionY
STA newY
LDA Object_health,x
SEC
SBC #$01 ;; subtract other's strength
CMP #$01
BCS notPlayerDeath
PlaySound #SND_HURT_PLAYER
JSR HandlePlayerDeath
JMP doneWithPlayerHurt
notPlayerDeath:
STA Object_health,x
STA myHealth
STA hudElementTilesToLoad
LDA #$00
STA hudElementTilesMax
; LDA DrawHudBytes
; ora #HUD_myHealth
; STA DrawHudBytes
UpdateHud HUD_myHealth
;; TURN ON handling the hud
LDA Object_status,x
ORA #%00000001
STA Object_status,x
LDA #HURT_TIMER
STA Object_timer_0,x
ChangeObjectState #$00,#$02 ;; uses idle for hurt state.
LDA selfCenterX
STA recoil_selfX
LDA selfCenterY
STA recoil_selfY
LDA otherCenterX
STA recoil_otherX
LDA otherCenterY
STA recoil_otherY
JSR DetermineRecoilDirection
;;;;; SCROLLER CAN NOT MAKE USE OF UPDATING HUD THIS WAY.
doneWithPlayerHurt: