powers

by ixitxachitl

Game:

Description:

;Power Switch - An Ultrabi Production
;Pressing X when Small, Big, or Fiery, it changes your powerup state to #$02 (Feather).
;If you press X with a feather, you switch to #$03 (Fire).
;You basically can't die with this activated so you might want to work around that.

main:
	LDA $1407		; \ Load if player is flying
	BNE return			; / If not jump to "return", if yes continue
	LDA $13ED	; \ Load if player is flying
	BNE return			; / If not jump to "return", if yes proceed
	LDA $16			  	; \ Load input of current frame
	AND #$80			; | Check if X has been pressed
	BNE change			; / If not proceed, if yes jump to "change"
	RTL					; > End code

change:
	LDA $19				; \ Load $19 (powerup)
	CMP #$02			; | Check if it's $02 (cape)
	BEQ changepowerup		; | If not proceed, if yes jump to "changepowerup"
	LDA #$02			; | Load $02 (cape)
	STA $19				; / Insert on $19 (powerup)
	RTL				; > End
changepowerup:
	LDA #$03			; \ Load $03 (flower)
	STA $19				; / Insert on $19 (powerup)
	RTL					; > End code

return:
	RTL					; > End code
print "Press X to change the player's current powerup."
back to listings