ootw: add crouch kicking, start hooking up more doors l2

This commit is contained in:
Vince Weaver 2019-08-16 16:32:59 -04:00
parent ae2b3583b2
commit aba8e609fc
9 changed files with 208 additions and 156 deletions

View File

@ -70,6 +70,7 @@ ootw_c2.o: ootw_c2.s \
ootw_graphics/sprites/friend.inc \
ootw_c2_cage.s ootw_c2_jail.s ootw_c2_elevator.s ootw_c2_intro.s \
ootw_graphics/l2cage/ootw_c2_cage.inc \
ootw_graphics/l2jail/ootw_c2_jail.inc \
ootw_graphics/l2intro/ootw_l2intro.inc \
ootw_graphics/l2laser/ootw_c2_laser.inc
ca65 -o ootw_c2.o ootw_c2.s -l ootw_c2.lst

View File

@ -6,6 +6,11 @@ Before release:
properly handle when multiple collision objects
on screen at once
door explosions should be cropped
after teleport, re-run room boundary calcs
when calculating room calcs, take Y position into account
L1 -- fix run/jumping
L1 -- fix beast ending
L1 -- fix slugs
@ -16,10 +21,6 @@ Before release:
L2 -- add minimal friend AI
L2 -- add way to leave L2 to L3
L4 -- genericze doors
L4 -- blow up door to exit to L5
L4 -- allow crouching w gun, up to exit crouch
L5 -- add ending scenes?
intro -- add music?

View File

@ -337,7 +337,7 @@ check_space:
jmp unknown
;======================
; Kick or shoot
; SPACE -- Kick or shoot
;======================
space:
lda HAVE_GUN
@ -371,7 +371,16 @@ stand_stance:
jmp change_state_clear_gait
kick:
lda PHYSICIST_STATE
cmp #P_CROUCHING
bne kick_standing
lda #P_CROUCH_KICKING
jmp kick_final
kick_standing:
lda #P_KICKING
kick_final:
sta PHYSICIST_STATE
lda #15
sta GAIT

View File

@ -18,7 +18,6 @@ ootw_jail_init:
sta CHARGER_COUNT
sta GUN_STATE
sta GUN_FIRE
sta NUM_DOORS
lda #100
sta GUN_CHARGE
@ -58,7 +57,7 @@ ootw_jail_init:
lda #6
sta alien0_room
lda #26
lda #20
sta alien0_x
lda #20
@ -72,6 +71,16 @@ ootw_jail_init:
rts
; Map
;
; DD
; ||
; R0=R1=R2=R3=E1
; ||
; R5=R4=E2
; ||
; R6=E3
;===========================
; enter new room in jail
@ -85,6 +94,7 @@ ootw_jail:
lda #0
sta ON_ELEVATOR
sta TELEPORTING
sta NUM_DOORS
;============================
; init shields
@ -103,6 +113,9 @@ ootw_jail:
lda WHICH_JAIL
bne jail1
;===================
; initial room
jail0:
lda #(24+128)
sta LEFT_LIMIT
@ -127,6 +140,8 @@ jail0:
jmp jail_setup_done
;===================
; first cellblock
jail1:
cmp #1
bne jail2
@ -154,6 +169,8 @@ jail1:
jmp jail_setup_done
;===================
; second cellblock
jail2:
cmp #2
bne jail3
@ -178,10 +195,21 @@ jail2:
jmp jail_setup_done
;===================
; room with doors
jail3:
cmp #3
bne jail4
lda #3
sta NUM_DOORS
lda #<door_c2_r3
sta setup_door_table_loop_smc+1
lda #>door_c2_r3
sta setup_door_table_loop_smc+2
jsr setup_door_table
lda #(-4+128)
sta LEFT_LIMIT
lda #(39+128)
@ -205,10 +233,24 @@ jail3:
jmp jail_setup_done
;===================
; multi-level room
jail4:
cmp #4
bne jail5
lda #<door_c2_r4
sta setup_door_table_loop_smc+1
lda #>door_c2_r4
sta setup_door_table_loop_smc+2
jsr setup_door_table
lda #4
sta NUM_DOORS
lda PHYSICIST_Y
cmp #30 ; see if coming in on bottom
bne jail4_top
@ -468,6 +510,13 @@ actively_teleporting:
jsr put_sprite_crop
dec TELEPORTING
bne c2_done_draw_physicist
;================
; recalc collision on new floor
jsr recalc_walk_collision
c2_done_draw_physicist:
@ -1017,39 +1066,76 @@ gun_movie_loop:
rts
door_c2_r3:
.word door_c2_r3_status
.word door_c2_r3_x
.word door_c2_r3_y
.word door_c2_r3_xmin
.word door_c2_r3_xmax
door_y:
c4_r0_door0_y: .byte 24
c4_r0_door1_y: .byte 24
c4_r0_door2_y: .byte 24
c4_r0_door3_y: .byte 24
c4_r0_door4_y: .byte 24
door_c2_r3_status:
c2_r3_door0_status: .byte DOOR_STATUS_CLOSED
c2_r3_door1_status: .byte DOOR_STATUS_CLOSED
c2_r3_door2_status: .byte DOOR_STATUS_CLOSED
door_status:
c4_r0_door0_status: .byte DOOR_STATUS_CLOSED
c4_r0_door1_status: .byte DOOR_STATUS_CLOSED
c4_r0_door2_status: .byte DOOR_STATUS_LOCKED
c4_r0_door3_status: .byte DOOR_STATUS_LOCKED
c4_r0_door4_status: .byte DOOR_STATUS_LOCKED
door_c2_r3_y:
c2_r3_door0_y: .byte 26
c2_r3_door1_y: .byte 26
c2_r3_door2_y: .byte 26
door_x:
c4_r0_door0_x: .byte 7
c4_r0_door1_x: .byte 18
c4_r0_door2_x: .byte 29
c4_r0_door3_x: .byte 31
c4_r0_door4_x: .byte 33
door_c2_r3_x:
c2_r3_door0_x: .byte 35
c2_r3_door1_x: .byte 37
c2_r3_door2_x: .byte 39
door_c2_r3_xmin:
c2_r3_door0_xmin: .byte 26 ; 35-4-5
c2_r3_door1_xmin: .byte 28 ; 37-4-5
c2_r3_door2_xmin: .byte 30 ; 39-4-5
door_c2_r3_xmax:
c2_r3_door0_xmax: .byte 39 ; 35+4
c2_r3_door1_xmax: .byte 41 ; 37+4
c2_r3_door2_xmax: .byte 43 ; 39+4
door_c2_r4:
.word door_c2_r4_status
.word door_c2_r4_x
.word door_c2_r4_y
.word door_c2_r4_xmin
.word door_c2_r4_xmax
door_c2_r4_status:
c2_r4_door0_status: .byte DOOR_STATUS_CLOSED
c2_r4_door1_status: .byte DOOR_STATUS_CLOSED
c2_r4_door2_status: .byte DOOR_STATUS_CLOSED
c2_r4_door3_status: .byte DOOR_STATUS_CLOSED
door_c2_r4_x:
c2_r4_door0_x: .byte 18
c2_r4_door1_x: .byte 20
c2_r4_door2_x: .byte 22
c2_r4_door3_x: .byte 32
door_c2_r4_y:
c2_r4_door0_y: .byte 28
c2_r4_door1_y: .byte 28
c2_r4_door2_y: .byte 28
c2_r4_door3_y: .byte 6
door_c2_r4_xmin:
c2_r4_door0_xmin: .byte 9 ; 18-4-5
c2_r4_door1_xmin: .byte 11 ; 20-4-5
c2_r4_door2_xmin: .byte 13 ; 22-4-5
c2_r4_door3_xmin: .byte 23 ; 32-4-5
door_c2_r4_xmax:
c2_r4_door0_xmax: .byte 22 ; 18+4
c2_r4_door1_xmax: .byte 24 ; 20+4
c2_r4_door2_xmax: .byte 26 ; 22+4
c2_r4_door3_xmax: .byte 36 ; 32+4
door_xmin:
c4_r0_door0_xmin: .byte 0 ; 7-4-5
c4_r0_door1_xmin: .byte 11 ; 18-4-5
c4_r0_door2_xmin: .byte 20 ; 29-4-5
c4_r0_door3_xmin: .byte 22 ; 31-4-5
c4_r0_door4_xmin: .byte 24 ; 33-4-5
door_xmax:
c4_r0_door0_xmax: .byte 11 ; 7+4
c4_r0_door1_xmax: .byte 21 ; 18+4
c4_r0_door2_xmax: .byte 33 ; don't care
c4_r0_door3_xmax: .byte 35 ; don't care
c4_r0_door4_xmax: .byte 37 ; don't care

View File

@ -410,39 +410,3 @@ large_rock:
door_y:
c4_r0_door0_y: .byte 24
c4_r0_door1_y: .byte 24
c4_r0_door2_y: .byte 24
c4_r0_door3_y: .byte 24
c4_r0_door4_y: .byte 24
door_status:
c4_r0_door0_status: .byte DOOR_STATUS_CLOSED
c4_r0_door1_status: .byte DOOR_STATUS_CLOSED
c4_r0_door2_status: .byte DOOR_STATUS_LOCKED
c4_r0_door3_status: .byte DOOR_STATUS_LOCKED
c4_r0_door4_status: .byte DOOR_STATUS_LOCKED
door_x:
c4_r0_door0_x: .byte 7
c4_r0_door1_x: .byte 18
c4_r0_door2_x: .byte 29
c4_r0_door3_x: .byte 31
c4_r0_door4_x: .byte 33
door_xmin:
c4_r0_door0_xmin: .byte 0 ; 7-4-5
c4_r0_door1_xmin: .byte 11 ; 18-4-5
c4_r0_door2_xmin: .byte 20 ; 29-4-5
c4_r0_door3_xmin: .byte 22 ; 31-4-5
c4_r0_door4_xmin: .byte 24 ; 33-4-5
door_xmax:
c4_r0_door0_xmax: .byte 11 ; 7+4
c4_r0_door1_xmax: .byte 21 ; 18+4
c4_r0_door2_xmax: .byte 33 ; don't care
c4_r0_door3_xmax: .byte 35 ; don't care
c4_r0_door4_xmax: .byte 37 ; don't care

View File

@ -10,7 +10,7 @@ all: ootw_c2_jail.inc
ootw_c2_jail.inc: $(PNG2RLE) \
jail2_bg.png jail3_bg.png jail4_bg.png dome.png \
room_b2.png room_b3.png room_b4.png
$(PNG2RLE) asm jail2_bg.png jail2_rle >> ootw_c2_jail.inc
$(PNG2RLE) asm jail2_bg.png jail2_rle > ootw_c2_jail.inc
$(PNG2RLE) asm jail3_bg.png jail3_rle >> ootw_c2_jail.inc
$(PNG2RLE) asm jail4_bg.png jail4_rle >> ootw_c2_jail.inc
$(PNG2RLE) asm dome.png dome_rle >> ootw_c2_jail.inc

View File

@ -152,56 +152,48 @@ jail3_rle: .byte $28 ; ysize=48
.byte $A1
jail4_rle: .byte $28 ; ysize=48
.byte $A0,$FF,$88, $A0,$FF,$88, $AA,$88, $A0,$1C,$20, $E0, $F0, $E0
.byte $20, $50, $20,$20, $00, $20, $00, $20
.byte $00, $22, $0A, $7A, $0A, $7A, $0A
.byte $22, $0A, $7A, $0A, $7A, $0A, $22
.byte $0A, $7A, $0A, $7A, $0A, $22,$22, $0A
.byte $7A, $0A, $7A, $0A, $22, $0A, $7A
.byte $0A, $7A, $0A, $22, $55, $22,$22, $00
.byte $22, $00, $22, $00, $22, $00, $77
.byte $20, $50, $A7,$20, $22, $0A, $7A, $0A
.byte $7A, $0A, $22, $0A, $7A, $0A, $7A
.byte $0A, $22, $0A, $7A, $0A, $7A, $0A
.byte $22,$22, $0A, $7A, $0A, $7A, $0A, $22
.byte $0A, $7A, $0A, $7A, $0A, $22, $55
.byte $A8,$22, $00, $77, $00, $77, $00, $22
.byte $00, $77, $00, $77, $00, $22, $00
.byte $77, $00, $77, $00, $22,$22, $00, $77
.byte $00, $77, $00, $22, $00, $77, $00
.byte $77, $00, $22, $55, $A8,$22, $00, $77
.byte $00, $77, $00, $22, $00, $77, $00
.byte $77, $00, $22, $00, $77, $00, $77
.byte $00, $22,$22, $00, $77, $00, $77, $00
.byte $22, $00, $77, $00, $77, $00, $22
.byte $55, $22,$22, $00, $22, $00, $22, $00
.byte $22, $00, $77, $00, $77, $00, $22
.byte $55, $A7,$22, $62, $00, $77, $00, $77
.byte $00, $22, $00, $77, $60, $77, $00
.byte $22, $00, $77, $00, $77, $00, $22,$22
.byte $00, $77, $00, $77, $00, $22, $00
.byte $77, $00, $77, $00, $22,$22, $00, $77
.byte $00, $77, $00, $22, $00, $77, $00
.byte $77, $00, $22, $55, $22,$22, $00, $22
.byte $00, $22, $00, $62, $00, $77, $00
.byte $77, $00, $22, $00, $77, $60, $77
.byte $00, $22, $00, $77, $00, $77, $00
.byte $22,$22, $00, $77, $00, $77, $00, $22
.byte $00, $77, $00, $77, $00, $22, $55
.byte $77,$77, $00, $22, $00, $22, $00, $26
.byte $00, $77, $00, $77, $88, $22, $00
.byte $77, $66, $77, $88, $22, $00, $77
.byte $00, $77, $88, $22,$22, $00, $77, $00
.byte $77, $88, $22, $00, $77, $00, $77
.byte $88, $22,$22, $77,$77, $00, $22, $00, $22
.byte $00, $22, $00, $77, $00, $77, $88
.byte $22, $55, $77, $00, $77, $58, $22
.byte $77, $00, $77, $00, $22, $55, $77,$77
.byte $A5,$22, $26, $00, $77, $00, $77, $88
.byte $22, $00, $77, $66, $77, $88, $22
.byte $00, $77, $00, $77, $88, $22,$22, $00
.byte $77, $00, $77, $88, $22, $00, $77
.byte $00, $77, $88, $A4,$22, $00, $22, $00
.byte $22, $00, $22, $00, $77, $88, $77
.byte $88, $22, $55, $77, $00, $77, $05
.byte $00, $77, $88, $22,$22, $77,$77, $A6,$22, $00
.byte $77, $00, $77, $88, $22, $55, $77
.byte $00, $77, $58, $22, $00, $77, $00
.byte $77, $88, $22,$22, $00, $77, $00, $77
.byte $88, $22, $00, $77, $00, $77, $88
.byte $AA,$22, $00, $77, $88, $77, $88, $22
.byte $55, $77, $00, $77, $05, $22, $00
.byte $77, $88, $77, $88, $22,$22, $00, $77
.byte $88, $77, $88, $22, $00, $77, $88
.byte $77, $88, $AA,$22, $00, $77, $88, $77
.byte $88, $22, $05, $77, $66, $77, $00
.byte $22, $00, $77, $88, $77, $88, $22,$22
.byte $00, $77, $88, $77, $88, $22, $00
.byte $77, $88, $77, $88, $A4,$22, $00, $22
.byte $00, $22, $00, $22, $00, $77, $88
.byte $77, $88, $22, $05, $77, $66, $77
.byte $00, $22, $00, $77, $88, $77, $88
.byte $22,$22, $00, $77, $88, $77, $88, $22
.byte $00, $77, $88, $77, $88, $A4,$22, $00
.byte $22, $00, $22, $00, $52, $50, $57
.byte $58, $57, $58, $52, $50, $57, $58
.byte $57, $50, $52, $50, $57, $58, $57
.byte $58, $52,$52, $50, $57, $58, $57, $58
.byte $52, $50, $E7, $E8, $E7, $E8, $E2
.byte $A3,$52, $00, $52, $00, $52, $00, $A0,$1A,$05
.byte $A7,$0E, $A7,$05
.byte $77, $88, $77, $88, $A9,$22, $52, $50
.byte $57, $58, $57, $58, $52, $50, $57
.byte $58, $57, $50, $52, $50, $57, $58
.byte $57, $58, $52,$52, $50, $57, $58, $57
.byte $58, $52, $50, $E7, $E8, $E7, $E8
.byte $E2, $A8,$52, $A0,$1A,$05, $A7,$0E, $A7,$05
.byte $A1
dome_rle: .byte $28 ; ysize=48
.byte $A7,$66, $26, $A3,$22, $A0,$12,$00, $A3,$22, $26, $AD,$66
@ -275,38 +267,28 @@ room_b3_rle: .byte $28 ; ysize=48
.byte $A1
room_b4_rle: .byte $28 ; ysize=48
.byte $A0,$59,$88, $A0,$1F,$00, $A9,$88, $00, $65, $A3,$25, $27
.byte $2E, $2F, $2E, $27, $A4,$25, $A3,$55, $A6,$25
.byte $05, $A7,$25, $A9,$88, $00, $66, $AD,$22, $55
.byte $A7,$22, $00, $A7,$22, $A9,$88, $00, $66, $AD,$22
.byte $55, $A7,$22, $00, $A7,$22, $A9,$88, $00, $66
.byte $AD,$22, $55, $A7,$22, $00, $A7,$22, $A8,$88, $00,$00
.byte $66, $A0,$15,$22, $00, $A7,$22, $A8,$88, $00,$00, $66
.byte $A0,$15,$22, $00, $A7,$22, $A8,$88, $00,$00, $66, $A6,$22
.byte $52, $AE,$22, $00, $A7,$22, $A8,$88, $00,$00, $66
.byte $A6,$22, $55, $AE,$22, $00, $A7,$22, $A8,$88, $00,$00
.byte $66, $A4,$22, $62,$62, $55, $A6,$62, $52, $A7,$62
.byte $00, $A7,$62, $A6,$88, $A5,$00, $20, $22,$22, $02
.byte $A0,$24,$00, $20, $22,$22, $02, $A0,$19,$00, $A3,$25, $2E
.byte $2F, $2E, $25, $55, $A3,$25, $A7,$22, $00
.byte $22, $00, $22, $00, $AA,$22, $55, $00,$00
.byte $A4,$88, $A7,$22, $55, $AA,$22, $00, $22, $00
.byte $22, $00, $22,$22, $A3,$00, $20, $00, $22
.byte $2E, $2F, $2E, $27, $A4,$25, $A3,$55, $AE,$25
.byte $A9,$88, $00, $66, $AD,$22, $55, $AF,$22, $A9,$88
.byte $00, $66, $AD,$22, $55, $AF,$22, $A9,$88, $00
.byte $66, $AD,$22, $55, $AF,$22, $A8,$88, $00,$00, $66
.byte $A0,$1D,$22, $A8,$88, $00,$00, $66, $A0,$1D,$22, $A8,$88, $00,$00
.byte $66, $A6,$22, $52, $A0,$16,$22, $A8,$88, $00,$00, $66
.byte $A6,$22, $55, $A0,$16,$22, $A8,$88, $00,$00, $66, $A4,$22
.byte $62,$62, $55, $A6,$62, $52, $A7,$62, $02, $A7,$62
.byte $A6,$88, $A5,$00, $20, $22,$22, $02, $A0,$24,$00, $20
.byte $22,$22, $02, $A0,$19,$00, $A3,$25, $2E, $2F, $2E
.byte $25, $55, $A3,$25, $A0,$16,$22, $55, $00,$00, $A4,$88
.byte $A7,$22, $55, $A0,$11,$22, $A3,$00, $20, $00, $22
.byte $02, $22, $55, $00,$00, $A4,$88, $A7,$22, $25
.byte $AA,$22, $00, $22, $00, $22, $00, $22,$22
.byte $A3,$00, $22, $00, $22, $20, $22, $55
.byte $00,$00, $A4,$88, $A0,$12,$22, $00, $22, $00, $22
.byte $00, $22,$22, $A3,$00, $22, $00, $A3,$22, $55
.byte $00,$00, $A4,$88, $A3,$22, $02, $AE,$22, $00, $22
.byte $00, $22, $00, $22,$22, $A3,$00, $22, $00
.byte $A3,$22, $55, $00,$00, $A4,$88, $22,$22, $02, $20
.byte $22, $20, $22,$22, $20, $A9,$22, $00, $22
.byte $00, $22, $00, $22,$22, $A3,$00, $22, $00
.byte $A3,$22, $55, $00,$00, $A4,$88, $A4,$22, $20, $22,$22
.byte $20, $AA,$22, $00, $22, $00, $22, $00
.byte $22,$22, $A3,$00, $22, $00, $A3,$22, $55, $A3,$00
.byte $A3,$88, $A0,$12,$22, $00, $22, $00, $22, $00
.byte $22,$22, $A3,$00, $22, $00, $A3,$22, $66, $A3,$00
.byte $A3,$88, $50, $52, $A0,$10,$62, $00, $62, $00
.byte $62, $00, $62,$62, $A3,$60, $62, $60, $A3,$62
.byte $A0,$11,$22, $A3,$00, $22, $00, $22, $20, $22
.byte $55, $00,$00, $A4,$88, $A0,$19,$22, $A3,$00, $22, $00
.byte $A3,$22, $55, $00,$00, $A4,$88, $A3,$22, $02, $A0,$15,$22
.byte $A3,$00, $22, $00, $A3,$22, $55, $00,$00, $A4,$88
.byte $22,$22, $02, $20, $22, $20, $22,$22, $20
.byte $A0,$10,$22, $A3,$00, $22, $00, $A3,$22, $55, $00,$00
.byte $A4,$88, $A4,$22, $20, $22,$22, $20, $A0,$11,$22, $A3,$00
.byte $22, $00, $A3,$22, $55, $A3,$00, $A3,$88, $A0,$19,$22
.byte $A3,$00, $22, $00, $A3,$22, $66, $A3,$00, $A3,$88
.byte $50, $52, $A0,$17,$62, $A3,$60, $62, $60, $A3,$62
.byte $66, $A3,$00, $A3,$88, $A0,$22,$06, $A3,$00, $A3,$88
.byte $A1

View File

@ -363,15 +363,15 @@ crouch1:
.byte $5a,$fc,$f4
crouch2:
.byte 3,8
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
.byte $9a,$9a,$aa
.byte $bb,$99,$aa
.byte $aa,$0b,$0a
.byte $aa,$bb,$00
.byte $ba,$4b,$aa
.byte $54,$f4,$f4
.byte 5,8
.byte $AA,$aa,$aa,$aa,$AA
.byte $AA,$aa,$aa,$aa,$AA
.byte $AA,$9a,$9a,$aa,$AA
.byte $AA,$bb,$99,$aa,$AA
.byte $AA,$aa,$0b,$0a,$AA
.byte $AA,$aa,$bb,$00,$AA
.byte $AA,$ba,$4b,$aa,$AA
.byte $AA,$54,$f4,$f4,$AA
;=====================

View File

@ -198,6 +198,15 @@ physicist_crouching:
physicist_crouch_kicking:
dec GAIT
lda GAIT
bpl still_kicking
lda #P_CROUCHING
sta PHYSICIST_STATE
still_kicking:
lda #<crouch_kicking
sta INL