ootw: c2: elevator sort of works

This commit is contained in:
Vince Weaver 2019-07-12 12:24:37 -04:00
parent 84ee49868e
commit cb5dd337a3
3 changed files with 134 additions and 18 deletions

View File

@ -4,7 +4,6 @@ KNOWN BUGS:
TODO:
Movement:
+ running: Missing one running frame (?)
+ ability to run+jump
@ -56,11 +55,25 @@ cage room:
+ Animation of friend?
+ animated miners in background
+ 1-bit audio recording of friend talking
+ Implement enemies
Jail:
+ Foreground animations
+ Doors that open/blast?
Elevator:
+ Elevator ride, view of city?
+ Elevator ride
View:
+ music play when viewing city
Teleporters:
+ Implement
+ Sprite displayed as it happens
Level/Checkpoint #3:
+ Implement
Level/Checkpoint #4:
+ Implement

View File

@ -4,17 +4,17 @@ ootw_elevator:
;===========================
; Enable graphics
bit LORES
bit SET_GR
bit FULLGR
; bit LORES
; bit SET_GR
; bit FULLGR
;===========================
; Setup pages (is this necessary?)
lda #0
sta DRAW_PAGE
lda #1
sta DISP_PAGE
; lda #0
; sta DRAW_PAGE
; lda #1
; sta DISP_PAGE
;==============================
; setup physicist
@ -137,7 +137,7 @@ elevator_setup_done:
; copy to screen
jsr gr_copy_to_current
jsr page_flip
; jsr page_flip
;=================================
; setup vars
@ -252,12 +252,14 @@ elevator_check_up:
bne elevator_check_down
going_up:
jsr move_elevator
going_up_smc:
lda #7
sta WHICH_JAIL
lda #0
sta PHYSICIST_STATE
jmp done_elevator
@ -266,17 +268,17 @@ elevator_check_down:
bne going_nowhere
going_down:
jsr move_elevator
going_down_smc:
lda #4
sta WHICH_JAIL
lda #0
sta PHYSICIST_STATE
jmp done_elevator
going_nowhere:
@ -687,3 +689,103 @@ city_frames:
.word city14_rle ; 16
.word city14_rle ; 17
;====================================
; run the elevator ride
;====================================
move_elevator:
lda PHYSICIST_STATE
cmp #P_ELEVATING_UP
bne move_elevator_down
move_elevator_up:
lda WHICH_JAIL
cmp #10 ; if top floor, no up
beq elevator_all_done
lda ELEVATOR_OFFSET
sec
sbc #48
sta elevator_end_smc+1
lda #$C6 ; dec
sta elevator_direction_smc
jmp move_elevator_loop
move_elevator_down:
lda WHICH_JAIL
cmp #9 ; if bottom floor, no down
beq elevator_all_done
lda ELEVATOR_OFFSET
clc
adc #48
sta elevator_end_smc+1
lda #$E6 ; inc
sta elevator_direction_smc
move_elevator_loop:
lda #0
sta PHYSICIST_STATE
elevator_direction_smc:
inc ELEVATOR_OFFSET ; E6=inc, C6=DEC
jsr elevator_load_background
jsr gr_copy_to_current
;===============
; draw physicist
jsr draw_physicist
;================================
; draw elevator moving
lda #16
sta XPOS
lda #32
sta YPOS
lda FRAMEL
and #$10
bne elevator_moving_anim2
lda #<elevator_sprite1
sta INL
lda #>elevator_sprite1
sta INH
jmp draw_moving_elevator
elevator_moving_anim2:
lda #<elevator_sprite2
sta INL
lda #>elevator_sprite2
sta INH
draw_moving_elevator:
jsr put_sprite_crop
jsr page_flip
lda ELEVATOR_OFFSET
elevator_end_smc:
cmp #$ff
bne move_elevator_loop
elevator_all_done:
lda #0
sta PHYSICIST_STATE
rts

View File

@ -120,7 +120,7 @@ jail4:
cmp #4
bne jail5
lda #(-4+128)
lda #(10+128)
sta LEFT_LIMIT
lda #(39+128)
sta RIGHT_LIMIT
@ -133,7 +133,8 @@ jail4:
lda #5
sta jel_smc+1
lda #30
; FIXME: different if in from left?
lda #8
sta PHYSICIST_Y
; load background