sa: ending: timed portals

This commit is contained in:
Vince Weaver 2018-06-05 00:40:01 -04:00
parent 4eed8a1ff2
commit 560a42543e

View File

@ -24,6 +24,7 @@ SY EQU $14
UXL EQU $15 UXL EQU $15
UXH EQU $16 UXH EQU $16
UY EQU $17 UY EQU $17
TIME EQU $18
HGR_SHAPE EQU $1A HGR_SHAPE EQU $1A
HGR_SHAPEH EQU $1B HGR_SHAPEH EQU $1B
@ -68,6 +69,7 @@ ending:
lda #0 lda #0
sta JO ; jam out sta JO ; jam out
sta KO ; core out sta KO ; core out
sta TIME
lda #1 lda #1
sta PR ; portals horizontal sta PR ; portals horizontal
@ -161,13 +163,45 @@ ending:
game_loop: game_loop:
lda KXL lda KXL ; update core co-ords
sta UXL sta UXL
lda KY lda KY
sta UY sta UY
lda KXH lda KXH
sta UXH sta UXH
lda TIME
beq no_time
inc TIME
cmp #30
bne time_60
time_30:
lda #1
sta SXH
lda #3
sta SXL
lda #50
sta SY
jsr draw_blue
jmp no_time
time_60:
cmp #60
bne no_time
lda #0
sta SXH
lda #149
sta SXL
lda #119
sta SY
jsr draw_orange
no_time:
;=================== ;===================
; Physics Engine ; Physics Engine
;=================== ;===================
@ -564,6 +598,11 @@ blue_portal_draw:
lda SY lda SY
sta BY sta BY
lda #<portal_horiz
sta HGR_SHAPE
lda #>portal_horiz
sta HGR_SHAPE+1
lda #1 lda #1
sta BO sta BO
@ -647,6 +686,11 @@ orange_portal_draw:
lda SY lda SY
sta GY sta GY
lda #<portal_horiz
sta HGR_SHAPE
lda #>portal_horiz
sta HGR_SHAPE+1
lda #1 lda #1
sta GO sta GO
@ -853,6 +897,10 @@ boom_loop:
lda #1 lda #1
sta KO ; KO=1 sta KO ; KO=1
; start time counting
lda #1
sta TIME
rts rts