lemm: work on builder

This commit is contained in:
Vince Weaver 2022-04-01 00:33:33 -04:00
parent 6872291993
commit 0cad221d9e
2 changed files with 86 additions and 17 deletions

View File

@ -1,5 +1,11 @@
+ Try oring the lemmings sprites instead of over-writing
(did this, but now they have red hair sometimes?) + special case
no collision with all-white frames (allow walking through bridges)
no climbing on spikes
+ have bridge stop building when hits wall
(real game, reverses too maybe?)
+ bridges you can walk through from underneath, not + bridges you can walk through from underneath, not
sure how to implement that sure how to implement that

View File

@ -381,43 +381,100 @@ no_bashing_this_frame:
;
; xxxxxxx
; xxxxxxx
; xxxxxxx
; xxxxxxx
;
;===================== ;=====================
; building ; building
;===================== ;=====================
do_lemming_building: do_lemming_building:
ldy CURRENT_LEMMING ldy CURRENT_LEMMING
lda lemming_frame,Y lda lemming_frame,Y
and #$f and #$7
bne no_building_this_frame ; only move dirt on frame 0 beq yes_building_this_frame
jmp no_building_this_frame ; only move dirt on frame 0
yes_building_this_frame:
ldx #7 ; draw white block ldx #7 ; draw white block
stx HGR_COLOR stx HGR_COLOR
; (X,A) to (X,A+Y) where X is xcoord/7 lda lemming_attribute,Y
and #$1
bne building_odd
building_even:
jsr hgr_box_page_toggle ; erase box page1
ldy CURRENT_LEMMING ldy CURRENT_LEMMING
lda lemming_y,Y
clc
adc #8
tax ; get row info for Y1 into GBASL/GBASH
lda hposn_high,X
sta GBASH
lda hposn_low,X
sta GBASL
lda lemming_x,Y lda lemming_x,Y
clc clc
adc lemming_direction,Y adc lemming_direction,Y
tax tay
lda #$ff
sta (GBASL),Y
lda GBASH
clc
adc #$20
sta GBASH
lda #$ff
sta (GBASL),Y
jmp update_building
building_odd:
ldy CURRENT_LEMMING
lda lemming_y,Y lda lemming_y,Y
clc clc
adc #7 adc #7
ldy #2
jsr hgr_box
jsr hgr_box_page_toggle ; erase box page2 tax ; get row info for Y1 into GBASL/GBASH
ldy CURRENT_LEMMING lda hposn_high,X
sta GBASH
lda hposn_low,X
sta GBASL
lda lemming_x,Y lda lemming_x,Y
clc clc
adc lemming_direction,Y adc lemming_direction,Y
tax tay
lda lemming_y,Y
lda #$ff
sta (GBASL),Y
iny
sta (GBASL),Y
dey
lda GBASH
clc clc
adc #7 adc #$20
ldy #2 sta GBASH
jsr hgr_box lda #$ff
sta (GBASL),Y
iny
sta (GBASL),Y
ldx CURRENT_LEMMING ; move 2 lines up ldx CURRENT_LEMMING ; move 2 lines up
@ -430,9 +487,12 @@ do_lemming_building:
adc lemming_direction,X adc lemming_direction,X
sta lemming_x,X sta lemming_x,X
update_building:
ldx CURRENT_LEMMING
inc lemming_attribute,X inc lemming_attribute,X
lda lemming_attribute,X lda lemming_attribute,X
cmp #12 and #$f
cmp #11
bne done_building bne done_building
; hit the end! ; hit the end!
@ -440,6 +500,9 @@ do_lemming_building:
lda #LEMMING_SHRUGGING lda #LEMMING_SHRUGGING
sta lemming_status,X sta lemming_status,X
lda #0
sta lemming_frame,X
no_building_this_frame: no_building_this_frame:
done_building: done_building:
jmp done_move_lemming jmp done_move_lemming