From e4ae83c77333cc43bbb6de43861b7151d04aca41 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 14 Sep 2024 12:35:16 -0400 Subject: [PATCH] climb: can now fall from upper levels --- games/peasant_mini/cliff/climb.s | 6 ++-- games/peasant_mini/cliff/move_peasant_climb.s | 31 +++++++++++++++++-- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/games/peasant_mini/cliff/climb.s b/games/peasant_mini/cliff/climb.s index f84eef0e..1033a778 100644 --- a/games/peasant_mini/cliff/climb.s +++ b/games/peasant_mini/cliff/climb.s @@ -407,7 +407,7 @@ flame_good: jsr check_keyboard lda LEVEL_OVER - bne top_cliff + bne cliff_reload_bg ; delay @@ -416,9 +416,7 @@ flame_good: jmp game_loop - -top_cliff: - inc MAP_LOCATION +cliff_reload_bg: jsr load_graphics lda #0 diff --git a/games/peasant_mini/cliff/move_peasant_climb.s b/games/peasant_mini/cliff/move_peasant_climb.s index 68d7b4c7..0c274ed9 100644 --- a/games/peasant_mini/cliff/move_peasant_climb.s +++ b/games/peasant_mini/cliff/move_peasant_climb.s @@ -1,5 +1,6 @@ ; Move that Peasant! +; climbing edition ; note: left/right across screen is roughly 24 keypresses ; width on Apple II roughly 30 across @@ -27,8 +28,29 @@ peasant_falling: jsr erase_peasant - ; FIXME: if not on screen0 + ; falling, see if hit bottom + ; + lda MAP_LOCATION + beq check_falling_hit_ground + + ; otherwise see if hit bottom of screen + lda PEASANT_Y + cmp #180 + bcc move_falling_peasant + + ; new screen + + dec MAP_LOCATION + lda #12 ; move back to top of screen + sta PEASANT_Y + + lda #$FF + sta LEVEL_OVER + jmp done_falling_peasant + + +check_falling_hit_ground: lda PEASANT_Y cmp #115 @@ -202,13 +224,18 @@ peasant_y_toobig: ;============================ + ; move up over top of screen + peasant_y_negative: -; jsr move_map_north lda #$FF sta LEVEL_OVER + inc MAP_LOCATION + ; FIXME: if high enough, we won + ; in the coach Z version, increase score + lda #158 ; new Y location jmp done_movey