ootw: start work on ceiling slugs

This commit is contained in:
Vince Weaver 2019-01-24 16:03:29 -05:00
parent 0a24ac5d86
commit abac1ff1d6
2 changed files with 100 additions and 78 deletions

View File

@ -1,46 +1,62 @@
; Sluggy Freelance
; slug behavior:
; cavern1: three slugs: 2 on ceiling
; cavern2: four slugs: 1 on ceiling, but 3 more will respawn on ceiling
; Crawl forward. When close, attack.
; Ceiling: crawl until within X of physicist
; then swing a few times and fall
; face toward physicist when start crawling
; Attacks: only attack if on ground and physicist is on ground
; will attempt to attack if you jump over
; Off edge of screen: will disappear but will respawn if leave/re-enter
;==================================
; draw slugs
;==================================
SLUG_STRUCT_SIZE = 7
SLUG_STRUCT_SIZE = 8
; out-state 0=dead 1=normal (2=falling?)
; TODO: use less space? merge some of these?
slugg0_out: .byte 1 ; 0
slugg0_attack: .byte 0 ; 1
slugg0_dying: .byte 0 ; 2
slugg0_x: .byte 30 ; 3
slugg0_y: .byte 30 ; 3
slugg0_dir: .byte $ff ; 4
slugg0_gait: .byte 0 ; 5
slugg0_y: .byte 30 ; 4
slugg0_dir: .byte $ff ; 5
slugg0_gait: .byte 0 ; 6
slugg0_falling: .byte 0 ; 7
slugg1_out: .byte 1 ; 6
slugg1_out: .byte 1 ; 8
slugg1_attack: .byte 0
slugg1_dying: .byte 0
slugg1_x: .byte 30
slugg1_y: .byte 30
slugg1_dir: .byte $ff
slugg1_gait: .byte 0
slugg1_falling: .byte 0
slugg2_out: .byte 1
slugg2_attack: .byte 0
slugg2_dying: .byte 0
slugg2_x: .byte 30
slugg2_y: .byte 30
slugg2_y: .byte 0
slugg2_dir: .byte $ff
slugg2_gait: .byte 0
slugg2_falling: .byte 0
slugg3_out: .byte 1 ; 0
slugg3_attack: .byte 0 ; 1
slugg3_dying: .byte 0 ; 2
slugg3_x: .byte 30 ; 3
slugg3_y: .byte 30 ; 3
slugg3_dir: .byte $ff ; 4
slugg3_gait: .byte 0 ; 5
slugg3_y: .byte 30 ; 4
slugg3_dir: .byte $ff ; 5
slugg3_gait: .byte 0 ; 6
slugg3_falling: .byte 0 ; 7
slugg4_out: .byte 1 ; 6
slugg4_attack: .byte 0
@ -49,6 +65,7 @@ slugg4_x: .byte 30
slugg4_y: .byte 30
slugg4_dir: .byte $ff
slugg4_gait: .byte 0
slugg4_falling: .byte 0
slugg5_out: .byte 1
slugg5_attack: .byte 0
@ -57,23 +74,25 @@ slugg5_x: .byte 30
slugg5_y: .byte 30
slugg5_dir: .byte $ff
slugg5_gait: .byte 0
slugg5_falling: .byte 0
slugg6_out: .byte 1
slugg6_attack: .byte 0
slugg6_dying: .byte 0
slugg6_x: .byte 30
slugg6_y: .byte 30
slugg6_y: .byte 0
slugg6_dir: .byte $ff
slugg6_gait: .byte 0
slugg6_falling: .byte 0
slugg7_out: .byte 1
slugg7_attack: .byte 0
slugg7_dying: .byte 0
slugg7_x: .byte 30
slugg7_y: .byte 30
slugg7_y: .byte 0
slugg7_dir: .byte $ff
slugg7_gait: .byte 0
slugg7_falling: .byte 0
;========================
@ -144,7 +163,7 @@ slugx_not_too_high:
draw_slugs:
ds_smc1:
ldx #0
ldx #0 ; loop through all. self-modify
stx WHICH_SLUG
draw_slugs_loop:
ldx WHICH_SLUG
@ -157,6 +176,10 @@ check_kicked:
cmp #1
bne check_attack
lda slugg0_y,X ; only kick if on ground
cmp #30
bne check_attack
;==================
; see if kicked
@ -184,10 +207,18 @@ check_attack:
;==================
; see if attack
lda slugg0_out,X
lda slugg0_out,X ; only attack if out
cmp #1
bne no_attack
lda slugg0_y,X ; only attack if on ground
cmp #30
bne no_attack
lda PHYSICIST_Y ; only attack if physicist on ground
cmp #22
bne no_attack
lda PHYSICIST_X
sec
sbc slugg0_x,X ; -2 to +2

View File

@ -10,11 +10,21 @@ slug1:
.byte $0a,$0a,$0a,$0a
slug2:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $0a,$a0,$0a,$aa
.byte $3,$4
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
.byte $0a,$a0,$0a
;===============
;===============
; slug on roof
; swings a bit, then falls
;=======================
; slug dying
slug_die_progression:
.word slug_die4 ; 0
@ -25,18 +35,18 @@ slug_die_progression:
.word slug_die1 ; 10
slug_die1:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $0a,$aa,$aa,$aa
.byte $aa,$0a,$aa,$aa
.byte $2,$4
.byte $aa,$aa
.byte $aa,$aa
.byte $0a,$aa
.byte $aa,$0a
slug_die2:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $0a,$aa,$aa,$aa
.byte $aa,$0a,$aa,$aa
.byte $aa,$aa,$a0,$aa
.byte $3,$4
.byte $aa,$aa,$aa
.byte $0a,$aa,$aa
.byte $aa,$0a,$aa
.byte $aa,$aa,$a0
slug_die3:
.byte $4,$4
@ -52,7 +62,9 @@ slug_die4:
.byte $aa,$aa,$aa,$aa,$a0
.byte $aa,$aa,$aa,$aa,$aa
;===============
;===============
; slug attacking
slug_attack_progression:
.word slug_attack0
@ -65,60 +77,39 @@ slug_attack_progression:
.word slug_attack3
slug_attack0:
.byte $4,$4
.byte $aa,$aa,$00,$aa
.byte $aa,$aa,$00,$aa
.byte $aa,$aa,$00,$aa
.byte $aa,$aa,$00,$aa
.byte $3,$4
.byte $aa,$aa,$00
.byte $aa,$aa,$00
.byte $aa,$aa,$00
.byte $aa,$aa,$00
slug_attack1:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $00,$aa,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$aa,$00,$aa
.byte $3,$4
.byte $aa,$aa,$aa
.byte $00,$aa,$aa
.byte $aa,$00,$aa
.byte $aa,$aa,$00
slug_attack2:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $00,$00,$00,$aa
.byte $3,$4
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
.byte $00,$00,$00
slug_attack3:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$00,$aa
.byte $aa,$00,$aa,$aa
.byte $00,$aa,$aa,$aa
.byte $3,$4
.byte $aa,$aa,$aa
.byte $aa,$aa,$00
.byte $aa,$00,$aa
.byte $00,$aa,$aa
slug_attack4:
.byte $4,$4
.byte $aa,$aa,$aa,$aa
.byte $00,$aa,$aa,$aa
.byte $00,$aa,$aa,$aa
.byte $00,$aa,$aa,$aa
;slug_attack5:
; .byte $4,$4
; .byte $aa,$aa,$aa,$aa
; .byte $00,$aa,$aa,$aa
; .byte $aa,$00,$aa,$aa
; .byte $aa,$aa,$00,$aa
;slug_attack6:
; .byte $4,$4
; .byte $aa,$aa,$aa,$aa
; .byte $aa,$aa,$aa,$aa
; .byte $aa,$aa,$aa,$aa
; .byte $00,$00,$00,$aa
;slug_attack7:
; .byte $4,$4
; .byte $aa,$aa,$aa,$aa
; .byte $aa,$aa,$00,$aa
; .byte $aa,$00,$aa,$aa
; .byte $00,$aa,$aa,$aa
.byte $1,$4
.byte $aa
.byte $00
.byte $00
.byte $00