lemm: can walk uphill now

This commit is contained in:
Vince Weaver 2022-03-18 01:59:15 -04:00
parent ef5a65bd48
commit b9135fe5a3
4 changed files with 39 additions and 7 deletions

View File

@ -5,6 +5,8 @@
+ fill in some of the ground so we don't get stuck when digging
+ Update credits?
+ "Out" counter is only printed to page1 so gets erased by cursor
+ Level2
+ Level3
+ Falling too far and you go splat
+ Have loadable levels
+ See if the jerky animation is due to starting at an odd x vs
even x, maybe we should start animation 4 frames in if that's
the case

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,4 +1,3 @@
;==========================
; move them
;==========================
@ -44,6 +43,9 @@ do_lemming_falling:
do_lemming_walking:
; see if ground has risen up
jsr collision_check_hill
; collision detect walls
@ -228,11 +230,9 @@ collision_check_ground:
ldy lemming_x
lda (GBASL),Y
and #$7f
beq ground_falling
beq ground_falling ; if empty space below us, fall
ground_walking:
; lda #0
; sta lemming_frame
lda #LEMMING_WALKING
lda #LEMMING_WALKING ; else, walk
jmp done_check_ground
ground_falling:
lda #LEMMING_FALLING
@ -240,3 +240,33 @@ done_check_ground:
sta lemming_status
rts
;=============================
; collision check hill
;=============================
collision_check_hill:
lda lemming_y
clc
adc #8
tay
lda hposn_high,Y
clc
adc #$20 ; check bg, not fg
sta GBASH
lda hposn_low,Y
sta GBASL
ldy lemming_x
lda (GBASL),Y
and #$7f
beq on_ground ; if empty space below us, good
underground:
dec lemming_y ; bump us up
on_ground:
rts