offparkway
Active member
was already grabbing it for you!Can you share that script?
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;SWAP PLAYER
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
canSwitchPlayer:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDA haveDill ;;did you unlock Dill?
BNE +
RTS
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
TXA
PHA
;; first, we will store every placement informations about the player
LDX player1_object
LDA Object_x_hi,x ;; the current horizontal position
; CLC
; ADC #$04
STA tempA
LDA Object_y_hi,x ;; the current vertical position
; CLC
; ADC #$04
STA tempB
LDA Object_direction,x ;; the current facing and movements
; AND #%00000111
STA tempC
;; now, depending of the current object used by the player:
;; we can switch to the new object, or switch back the normal one
LDA Object_type,x
BNE changeIntoNormal
LDA #15 ;; <-- HERE ! the new player object to transform into - DILL
STA tempPlayer
LDA #$03 ;; Frisbee
STA currentWeapon
WEAPON_SPRITE_0 = #$75
JMP continueChangePlayerInto
changeIntoNormal:
LDA #00 ;; the normal player object - JIM
STA tempPlayer
LDA #$01 ;; Rock
STA currentWeapon
WEAPON_SPRITE_0 = #$75
continueChangePlayerInto:
DestroyObject ;; we destroy the current object
CreateObject tempA, tempB, tempPlayer, #$00 ;; and create the new one
TXA
STA player1_object ;; store that new created object in the Player 1 var
STA camObject
; LDA tempC ;; set back the player directions
; STA Object_direction,x
PLA
TAX
doneSwitchingPlayer2:
RTS