From 744f3f9a64d5d534e799fd920be31e095403f625 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 14 Feb 2020 20:38:55 -0500 Subject: [PATCH] ootw: c15: add alien need to add real AI also fades into the background --- ootw/laser.s | 12 +++++++++++- ootw/ootw_c15.s | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/ootw/laser.s b/ootw/laser.s index cf377265..4b92bad9 100644 --- a/ootw/laser.s +++ b/ootw/laser.s @@ -381,5 +381,15 @@ done_hit_something: ; rts + ;=============== + ; clear lasers + ;=============== +clear_lasers: + ldx #MAX_LASERS + lda #0 +clear_laser_loop: + sta laser_out,X + dex + bne clear_laser_loop - + rts diff --git a/ootw/ootw_c15.s b/ootw/ootw_c15.s index 26d62bd7..c4308ee4 100644 --- a/ootw/ootw_c15.s +++ b/ootw/ootw_c15.s @@ -141,6 +141,24 @@ ootw_c15_level_init: lda #P_STANDING sta PHYSICIST_STATE + ; set up aliens + + jsr clear_aliens + + lda #1 + sta ALIEN_OUT + + lda #1 + sta alien0_room + lda #36 + sta alien0_x + lda #8 + sta alien0_y + lda #A_STANDING + sta alien0_state + lda #0 + sta alien0_direction + rts @@ -155,6 +173,8 @@ ootw_c15_setup_room_and_play: ;============================== ; each room init + jsr clear_lasers + lda #0 sta LEFT_SHOOT_LIMIT lda #39 @@ -202,6 +222,24 @@ room1: cmp #1 bne room2 + + ; +first_shield: + lda #0 + sta FIRST_SHIELD + sta shield_count + + lda #1 + sta shield_out + lda #34 + sta shield_x + + lda #8 + sta shield_y + + inc SHIELD_OUT + + ; reset for animation lda #0 sta FOREGROUND_COUNT @@ -463,6 +501,15 @@ c15_no_bg_action: jsr draw_physicist + ;===================================== + ; draw alien + ;===================================== + lda ALIEN_OUT + beq no_draw_alien + + jsr move_alien + jsr draw_alien +no_draw_alien: ;===================================== ; handle gun