mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-01 05:31:52 +00:00
sb: can activate shield
This commit is contained in:
parent
ce03614991
commit
0ce69e9a12
@ -101,6 +101,9 @@ load_background:
|
||||
lda #1
|
||||
sta STRONGBAD_DIR
|
||||
|
||||
lda #SHIELD_DOWN
|
||||
sta SHIELD_POSITION
|
||||
|
||||
;==========================
|
||||
; main loop
|
||||
;===========================
|
||||
@ -126,7 +129,7 @@ done_flip:
|
||||
sta DRAW_PAGE
|
||||
|
||||
;========================
|
||||
; copy over backgrund
|
||||
; copy over background
|
||||
;========================
|
||||
|
||||
jsr hgr_copy
|
||||
@ -182,9 +185,10 @@ no_move_head:
|
||||
; draw player
|
||||
;===========================
|
||||
|
||||
lda #<player_sprite
|
||||
ldx SHIELD_POSITION
|
||||
lda shield_sprites_l,X
|
||||
sta INL
|
||||
lda #>player_sprite
|
||||
lda shield_sprites_h,X
|
||||
sta INH
|
||||
lda PLAYER_X
|
||||
sta SPRITE_X
|
||||
@ -209,8 +213,11 @@ check_keypress:
|
||||
beq done_game
|
||||
|
||||
cmp #'A' ; shield left
|
||||
beq shield_left
|
||||
cmp #'S' ; shield center
|
||||
beq shield_center
|
||||
cmp #'D' ; shield right
|
||||
beq shield_right
|
||||
|
||||
cmp #8 ; left
|
||||
beq move_left
|
||||
@ -231,12 +238,23 @@ no_more_left:
|
||||
|
||||
move_right:
|
||||
lda PLAYER_X
|
||||
cmp #29 ; bge
|
||||
cmp #28 ; bge
|
||||
bcs no_more_right
|
||||
inc PLAYER_X
|
||||
no_more_right:
|
||||
jmp main_loop
|
||||
|
||||
shield_left:
|
||||
lda #SHIELD_UP_LEFT
|
||||
bne adjust_shield
|
||||
shield_center:
|
||||
lda #SHIELD_UP_CENTER
|
||||
bne adjust_shield
|
||||
shield_right:
|
||||
lda #SHIELD_UP_RIGHT
|
||||
adjust_shield:
|
||||
sta SHIELD_POSITION
|
||||
jmp main_loop
|
||||
|
||||
|
||||
|
||||
@ -273,3 +291,10 @@ comp_data:
|
||||
.incbin "asplode_graphics/sb_zone.hgr.zx02"
|
||||
|
||||
|
||||
shield_sprites_l:
|
||||
.byte <player_sprite,<shield_left_sprite
|
||||
.byte <shield_center_sprite,<shield_right_sprite
|
||||
|
||||
shield_sprites_h:
|
||||
.byte >player_sprite,>shield_left_sprite
|
||||
.byte >shield_center_sprite,>shield_right_sprite
|
||||
|
@ -33,7 +33,12 @@ sb_title.hgr: sb_title.png
|
||||
|
||||
sb_sprites.inc: sb_sprites.png
|
||||
$(HGR_SPRITE) -s -l head_sprite sb_sprites.png 84 36 132 92 > sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l player_sprite sb_sprites.png 112 138 167 192 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l player_sprite sb_sprites.png 98 138 181 192 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l shield_left_sprite sb_sprites.png 0 138 83 192 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l shield_center_sprite sb_sprites.png 196 83 279 137 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l shield_right_sprite sb_sprites.png 196 138 279 192 >> sb_sprites.inc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 14 KiB |
@ -65,6 +65,11 @@ NOT_FIRST_TIME = $6A
|
||||
STRONGBAD_X = $6B
|
||||
PLAYER_X = $6C
|
||||
STRONGBAD_DIR = $6D
|
||||
SHIELD_POSITION = $6E
|
||||
SHIELD_DOWN = 0
|
||||
SHIELD_UP_LEFT = 1
|
||||
SHIELD_UP_CENTER = 2
|
||||
SHIELD_UP_RIGHT = 3
|
||||
|
||||
.if 0
|
||||
REGISTER_DUMP = $70
|
||||
|
Loading…
Reference in New Issue
Block a user