coinrun

by snydej

Game:

Description: Running costs coins

!run_timer = $7FB010
!winded_timer = $7FB011
!frame_counter = $13
!pspeed = $13E4
!vx_ = $7b
!coins = $0DBF
!coin_sfx = $1DFC
!run_timer_init = #$01
!winded_timer_init = #$40

	lda !frame_counter
	bit #$0f
	bne check_winded
	lda !pspeed
	cmp #$10
	bmi reset_run_timer
	lda !run_timer
	beq take_coin
	dec
	sta !run_timer
	bra check_winded
take_coin:
	lda !coins
	beq make_winded
	dec
	sta !coins
	lda #$01
	sta !coin_sfx
reset_run_timer:
	lda !run_timer_init
	sta !run_timer
	bra check_winded
make_winded:
	lda !winded_timer_init
	sta !winded_timer
check_winded:
	lda !winded_timer
	beq +
	lda !winded_timer
	dec
	sta !winded_timer
	stz !vx_
	stz !pspeed
+	rtl
back to listings