ootw: adding aliens to levels, other small fixes

This commit is contained in:
Vince Weaver 2019-08-22 10:04:06 -04:00
parent bfa49720d1
commit a87138cb0e
6 changed files with 69 additions and 71 deletions

View File

@ -2,11 +2,6 @@
MAX_ALIENS = 3
alien_out:
alien0_out: .byte 0
alien1_out: .byte 0
alien2_out: .byte 0
alien_room:
alien0_room: .byte 0
alien1_room: .byte 0
@ -64,8 +59,9 @@ move_alien:
; FIXME: loop through all alieans
ldx #0
lda alien_out,X
beq done_move_alien
lda alien_room,X
cmp WHICH_ROOM
bne done_move_alien
lda alien_state,X
@ -176,8 +172,9 @@ draw_alien:
; FIXME
ldx #0
lda alien_out,X
beq no_alien
lda alien_room,X
cmp WHICH_ROOM
bne no_alien
lda alien_state,X
tay
@ -365,8 +362,8 @@ alien_disintegrating:
cmp #13
bne alien_keep_disintegrating
lda #0
sta alien_out,X
lda #$ff
sta alien_room,X
dec ALIEN_OUT
@ -464,41 +461,11 @@ alien_facing_right:
;==================
;==================
clear_aliens:
lda #0
sta alien0_out
sta alien1_out
sta alien2_out
lda #$ff
sta alien0_room
sta alien1_room
sta alien2_room
rts
;==============================
;==============================
; alien room init
;==============================
;==============================
alien_room_init:
;==============================
; if alien in room, set ALIEN_OUT
lda #0
sta ALIEN_OUT
ldx #0
alien_room_loop:
lda alien_out,X
beq alien_room_continue
lda alien_room,X
cmp WHICH_ROOM
bne alien_room_continue
inc ALIEN_OUT
alien_room_continue:
inx
cpx #MAX_ALIENS
bne alien_room_loop
rts

View File

@ -253,8 +253,9 @@ calc_gun_right_alien:
ldx #0
calc_gun_right_alien_loop:
lda alien_out,X
beq calc_gun_right_alien_continue
lda alien_room,X
cmp WHICH_ROOM
bne calc_gun_right_alien_continue
lda PHYSICIST_X
@ -461,8 +462,9 @@ calc_gun_left_alien:
calc_gun_left_alien_loop:
lda alien_out,X
beq calc_gun_left_alien_continue
lda alien_room,X
cmp WHICH_ROOM
bne calc_gun_left_alien_continue
lda PHYSICIST_X

View File

@ -29,12 +29,14 @@ fai_table_lo:
.byte <friend_ai_runto_panel ; 01
.byte <friend_ai_opening_panel ; 02
.byte <friend_ai_disintegrating ; 03
.byte <friend_ai_end_l2 ; 04
fai_table_hi:
.byte >friend_ai_following ; 00
.byte >friend_ai_runto_panel ; 01
.byte >friend_ai_opening_panel ; 02
.byte >friend_ai_disintegrating ; 03
.byte >friend_ai_end_l2 ; 04
;=======================================
@ -56,6 +58,7 @@ handle_friend_ai:
friend_ai_end_l2:
; FAI_END_L2
; crouch, holding panel open
rts
friend_ai_following:
; FAI_FOLLOWING

View File

@ -37,6 +37,7 @@ ootw_cage:
sta SHOOTING_BOTTOM
sta SHOOTING_TOP
sta LITTLEGUY_OUT
sta WHICH_ROOM
bit KEYRESET ; clear keypress
@ -436,8 +437,8 @@ guard_done_change:
; start patrol
lda #1
sta alien0_out
lda #0
sta alien0_room
lda #33
sta alien0_x

View File

@ -14,7 +14,6 @@ ootw_jail_init:
sta VENT_OPEN
sta LASER_OUT
sta ALIEN_OUT
sta BLAST_OUT
sta CHARGER_COUNT
sta GUN_STATE
@ -55,24 +54,48 @@ ootw_jail_init:
jsr clear_aliens
lda #1
sta alien0_out
lda #3
sta ALIEN_OUT
lda #6
; alien in hallway
lda #2
sta alien0_room
lda #20
lda #22
sta alien0_x
lda #20
lda #30
sta alien0_y
lda #A_STANDING
sta alien0_state
lda #0
lda #0 ; facing left
sta alien0_direction
; alien in basement
lda #6
sta alien1_room
lda #20
sta alien1_x
lda #20
sta alien1_y
lda #A_STANDING
sta alien1_state
lda #0
sta alien1_direction
; alien in break room
lda #4
sta alien2_room
lda #20
sta alien2_x
lda #20
sta alien2_y
lda #A_STANDING
sta alien2_state
lda #0
sta alien2_direction
rts
; Map
@ -108,7 +131,7 @@ ootw_jail:
;============================
; init alien room
jsr alien_room_init
; jsr alien_room_init
;==============================
@ -317,11 +340,16 @@ jail5:
bne jail6
; FIXME -- setup friend with open vent
; for now just always have him with it open
sta friend_room
lda #F_OPEN_VENT
sta friend_state
lda #0
sta friend_direction
lda #5
sta friend_room
lda #FAI_END_L2
sta friend_ai_state
; setup doors
@ -878,8 +906,10 @@ check_vent_falling:
cmp #P_STANDING
bne not_falling_down_vent
; vent at 18/19
; vent at 17/18/19
lda PHYSICIST_X
cmp #16
beq falling_down_vent
cmp #17
beq falling_down_vent
cmp #18

View File

@ -12,7 +12,6 @@ ootw_city_init:
sta BG_SCROLL
sta DIRECTION ; left
sta LASER_OUT
sta ALIEN_OUT
sta BLAST_OUT
sta CHARGER_COUNT
sta GUN_STATE
@ -41,20 +40,16 @@ ootw_city_init:
jsr clear_aliens
lda #1
sta alien0_out
sta ALIEN_OUT
lda #2
sta alien0_room
lda #27
sta alien0_x
lda #18
sta alien0_y
lda #A_STANDING
sta alien0_state
lda #0
sta alien0_direction
@ -104,7 +99,7 @@ ootw_city:
jsr init_shields
jsr alien_room_init
; jsr alien_room_init
lda #0