lemm: get blockers vs climbers working OK again

This commit is contained in:
Vince Weaver 2022-04-02 16:57:46 -04:00
parent b6e8de41ed
commit 17dd60972f
3 changed files with 52 additions and 0 deletions

View File

@ -367,6 +367,7 @@ draw_shrugging_common:
lda lemming_y,Y
clc
adc #1 ; offset by 1 for some reason
; guess I could update the sprites
jmp draw_lemming_common

View File

@ -316,6 +316,40 @@ make_stopper:
; put line on page2 to make lemmings reverse
; make it a specific pattern so climbers won't climb over
lda lemming_x,Y
sta dbl_smc2+1
lda lemming_y,Y
tax
inx
clc
adc #8
sta dbl_smc+1
draw_blocker_loop:
lda hposn_high,X
clc
adc #$20
sta GBASH
lda hposn_low,X
sta GBASL
dbl_smc2:
ldy #30
lda #$10
sta (GBASL),Y
inx
dbl_smc:
cpx #8
bne draw_blocker_loop
.if 0
; line from (x,a) to (x,a+y)
lda #$7
sta HGR_COLOR
@ -340,6 +374,7 @@ make_stopper:
jsr hgr_vlin
jsr hgr_vlin_page_toggle
.endif
cant_stop:
jmp done_keypress

View File

@ -204,6 +204,9 @@ walking_increment:
beq walking_no_wall
walking_yes_wall:
pha
; we hit a wall, reverse course, undo the increment
; Y is updated
@ -212,6 +215,12 @@ walking_yes_wall:
; check if climber, if so climb
ldy CURRENT_LEMMING
pla
cmp #$10
beq not_climber ; HACK: special case so climbers
; don't climb over stoppers
lda lemming_attribute,Y
and #LEMMING_CLIMBER
beq not_climber
@ -520,6 +529,13 @@ update_building:
and #$f
cmp #11
bne done_building
cmp #8
bcc no_build_click
jsr click_speaker
no_build_click:
; hit the end!