From 560a42543ecad3efa4befdc775f7e445f0a9d4a4 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 5 Jun 2018 00:40:01 -0400 Subject: [PATCH] sa: ending: timed portals --- still_alive/ending.s | 50 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/still_alive/ending.s b/still_alive/ending.s index 1b049ccb..9c6c2ea0 100644 --- a/still_alive/ending.s +++ b/still_alive/ending.s @@ -24,6 +24,7 @@ SY EQU $14 UXL EQU $15 UXH EQU $16 UY EQU $17 +TIME EQU $18 HGR_SHAPE EQU $1A HGR_SHAPEH EQU $1B @@ -68,6 +69,7 @@ ending: lda #0 sta JO ; jam out sta KO ; core out + sta TIME lda #1 sta PR ; portals horizontal @@ -161,13 +163,45 @@ ending: game_loop: - lda KXL + lda KXL ; update core co-ords sta UXL lda KY sta UY lda KXH 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 ;=================== @@ -564,6 +598,11 @@ blue_portal_draw: lda SY sta BY + lda #portal_horiz + sta HGR_SHAPE+1 + lda #1 sta BO @@ -647,6 +686,11 @@ orange_portal_draw: lda SY sta GY + lda #portal_horiz + sta HGR_SHAPE+1 + lda #1 sta GO @@ -853,6 +897,10 @@ boom_loop: lda #1 sta KO ; KO=1 + ; start time counting + lda #1 + sta TIME + rts