lemm: sort of added blockers

This commit is contained in:
Vince Weaver 2022-03-25 00:59:49 -04:00
parent 7ba8b5b8a4
commit ed5ec29895
4 changed files with 106 additions and 2 deletions

View File

@ -90,6 +90,8 @@ do_draw_lemming:
beq draw_particles
cmp #LEMMING_SPLATTING
beq draw_splatting_sprite
cmp #LEMMING_STOPPING
beq draw_stopping_sprite
draw_walking_sprite:
@ -161,6 +163,19 @@ draw_splatting_sprite:
jmp done_draw_lemming
;====================
; draw stopping
;====================
draw_stopping_sprite:
jsr handle_stopping
jmp done_draw_lemming
;====================
; draw particles
;====================
@ -385,6 +400,27 @@ umbrella_sprite_h:
.byte >lemming_umbrella5_sprite,>lemming_umbrella6_sprite
.byte >lemming_umbrella7_sprite,>lemming_umbrella8_sprite
stopper_sprite_l:
.byte <lemming_stopper1_sprite,<lemming_stopper2_sprite
.byte <lemming_stopper3_sprite,<lemming_stopper4_sprite
.byte <lemming_stopper5_sprite,<lemming_stopper6_sprite
.byte <lemming_stopper7_sprite,<lemming_stopper7_sprite
.byte <lemming_stopper9_sprite,<lemming_stopper10_sprite
.byte <lemming_stopper11_sprite,<lemming_stopper12_sprite
.byte <lemming_stopper13_sprite,<lemming_stopper14_sprite
.byte <lemming_stopper7_sprite,<lemming_stopper7_sprite
stopper_sprite_h:
.byte >lemming_stopper1_sprite,>lemming_stopper2_sprite
.byte >lemming_stopper3_sprite,>lemming_stopper4_sprite
.byte >lemming_stopper5_sprite,>lemming_stopper6_sprite
.byte >lemming_stopper7_sprite,>lemming_stopper7_sprite
.byte >lemming_stopper9_sprite,>lemming_stopper10_sprite
.byte >lemming_stopper11_sprite,>lemming_stopper12_sprite
.byte >lemming_stopper13_sprite,>lemming_stopper14_sprite
.byte >lemming_stopper7_sprite,>lemming_stopper7_sprite
;==========================
; Handle particles
@ -579,3 +615,31 @@ done_splatting:
clc
jsr remove_lemming ; FIXME: tail call
rts
;==========================
; Handle stopping
;==========================
handle_stopping:
lda lemming_frame,Y
and #$f
tax
lda stopper_sprite_l,X
sta INL
lda stopper_sprite_h,X
sta INH
ldx lemming_x,Y
stx XPOS
lda lemming_y,Y
sta YPOS
jsr hgr_draw_sprite_autoshift
rts

View File

@ -252,6 +252,7 @@ make_exploding:
jsr make_exploding_routine
jmp done_keypress
make_stopper:
jsr make_stopper_routine
jmp done_keypress
make_builder:
jmp done_keypress
@ -323,6 +324,45 @@ make_floater_routine:
sta lemming_attribute,Y
rts
;========================
; make stopper
;========================
make_stopper_routine:
lda lemming_status,Y
cmp #LEMMING_FLOATER ; can't stop if floating
beq cant_stop
cmp #LEMMING_FALLING ; can't stop if falling
beq cant_stop
lda #LEMMING_STOPPING
sta lemming_status,Y
; put line on page2 to make lemmings reverse
; line from (x,a) to (x,a+y)
lda #$7f
sta HGR_COLOR
jsr hgr_vlin_page_toggle
clc
lda lemming_x,Y ; multiply x by 7
asl
adc lemming_x,Y
asl
adc lemming_x,Y
tax
lda lemming_y,Y
ldy #10
jsr hgr_vlin
jsr hgr_vlin_page_toggle
cant_stop:
rts
;=============================

View File

@ -37,7 +37,7 @@ do_level3:
lda #15 ;
sta exit_x1_smc+1
lda #19
lda #20
sta exit_x2_smc+1
lda #122

View File

@ -34,7 +34,7 @@ title_loop:
title_text:
.byte 0, 0,"LOADING LEMM V0.03 (23 MAR 2022)",0
.byte 0, 0,"LOADING LEMM V0.04 (25 MAR 2022)",0
.byte 0, 1," LEMM PROOF-OF-CONCEPT DEMAKE",0
.byte 0, 3,"BASED ON LEMMINGS BY DMA DESIGN",0
.byte 0, 5," APPLE II PORT: VINCE WEAVER",0