diff --git a/games/peasant/Makefile b/games/peasant/Makefile index cb1e4af4..fe3951b8 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -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 diff --git a/games/peasant/TODO b/games/peasant/TODO index ecebf127..a4dc7aa5 100644 --- a/games/peasant/TODO +++ b/games/peasant/TODO @@ -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 diff --git a/games/peasant/cottage.s b/games/peasant/cottage.s index 11048fd7..f245a229 100644 --- a/games/peasant/cottage.s +++ b/games/peasant/cottage.s @@ -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 diff --git a/games/peasant/knight.s b/games/peasant/knight.s index 4e9d7ccd..e700a739 100644 --- a/games/peasant/knight.s +++ b/games/peasant/knight.s @@ -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 diff --git a/games/peasant/lake_e.s b/games/peasant/lake_e.s index ed319c95..c32fadda 100644 --- a/games/peasant/lake_e.s +++ b/games/peasant/lake_e.s @@ -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 diff --git a/games/peasant/lake_w.s b/games/peasant/lake_w.s index 9084e10d..6d73fedf 100644 --- a/games/peasant/lake_w.s +++ b/games/peasant/lake_w.s @@ -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 diff --git a/games/peasant/peasant.s b/games/peasant/peasant.s index e8a29aa3..24ed91b1 100644 --- a/games/peasant/peasant.s +++ b/games/peasant/peasant.s @@ -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" diff --git a/games/peasant/river.s b/games/peasant/river.s index d7a2430b..fa61f1d1 100644 --- a/games/peasant/river.s +++ b/games/peasant/river.s @@ -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 diff --git a/games/peasant/wait_a_bit.s b/games/peasant/wait_a_bit.s new file mode 100644 index 00000000..a2fabae2 --- /dev/null +++ b/games/peasant/wait_a_bit.s @@ -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 +