peasant: auto-walk everywhere now

This commit is contained in:
Vince Weaver 2021-08-12 15:41:39 -04:00
parent f75ed63451
commit b454576d61
9 changed files with 82 additions and 12 deletions

View File

@ -69,6 +69,7 @@ PEASANT: peasant.o
peasant.o: peasant.s graphics/graphics.inc sprites/peasant_sprite.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_7x30_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
wait_a_bit.s \
title.s directions.s \
cottage.s lake_w.s lake_e.s river.s knight.s \
ending.s

View File

@ -1,2 +1,9 @@
TODO:
- Music
- Animate Title
- walk behind objects (like reeds?)
- More frames/directions in peasant sprites
- Replace HPOSN with lookup table
- Wait instead of keyboard to progress
- Better animation of River

View File

@ -43,8 +43,7 @@ cottage:
jsr hgr_put_string
; jsr display_cottage_text3
jsr hgr_save
;====================
; save background
@ -72,12 +71,14 @@ check_cottage_action1:
check_cottage_action2:
cmp #1
bne check_cottage_action3
jsr hgr_restore
jsr display_cottage_text2
jmp done_cottage_action
check_cottage_action3:
cmp #13
bne done_cottage_action
jsr hgr_restore
jsr display_cottage_text3
done_cottage_action:
@ -100,7 +101,22 @@ done_cottage_action:
jsr draw_peasant
jsr wait_until_keypress
; jsr wait_until_keypress
lda FRAME
bne special2
lda #25
jmp now_wait
special2:
cmp #1
bne regular_wait
lda #12
jmp now_wait
regular_wait:
lda #3
now_wait:
jsr wait_a_bit
inc FRAME

View File

@ -98,7 +98,10 @@ done_knight_action:
jsr draw_peasant
jsr wait_until_keypress
; jsr wait_until_keypress
lda #3
jsr wait_a_bit
inc FRAME
@ -112,6 +115,12 @@ done_knight:
; OK stuff goes on here
jsr draw_peasant
; wait a bit
lda #10
jsr wait_a_bit
; restore bg

View File

@ -92,7 +92,10 @@ done_lake_e_action:
jsr draw_peasant
jsr wait_until_keypress
; jsr wait_until_keypress
lda #3
jsr wait_a_bit
inc FRAME

View File

@ -38,7 +38,7 @@ lake_west:
jsr hgr_put_string
; jsr display_cottage_text3
jsr hgr_save
;====================
; save background
@ -66,6 +66,7 @@ check_lake_w_action1:
check_lake_w_action2:
cmp #20
bne done_lake_w_action
jsr hgr_restore
jsr display_lake_w_text1
done_lake_w_action:
@ -92,7 +93,10 @@ done_lake_w_action:
jsr draw_peasant
jsr wait_until_keypress
; jsr wait_until_keypress
lda #3
jsr wait_a_bit
inc FRAME

View File

@ -22,25 +22,25 @@ peasant_quest:
; Cottage
;************************
; jsr cottage
jsr cottage
;************************
; Lake West
;************************
; jsr lake_west
jsr lake_west
;************************
; Lake East
;************************
; jsr lake_east
jsr lake_east
;************************
; River
;************************
; jsr river
jsr river
;************************
; Knight
@ -74,5 +74,6 @@ peasant_quest:
.include "hgr_1x5_sprite.s"
.include "hgr_save_restore.s"
.include "hgr_input.s"
.include "wait_a_bit.s"
.include "graphics/graphics.inc"

View File

@ -95,7 +95,10 @@ done_river_action:
jsr draw_peasant
jsr wait_until_keypress
; jsr wait_until_keypress
lda #3
jsr wait_a_bit
inc FRAME

View File

@ -0,0 +1,26 @@
;====================================
; wait for keypress or a few seconds
;====================================
; A is length to wait
wait_a_bit:
bit KEYRESET
tax
keyloop:
lda #200 ; delay a bit
jsr WAIT
lda KEYPRESS
bmi done_keyloop
dex
bne keyloop
done_keyloop:
bit KEYRESET
rts