Skip to content

Commit

Permalink
Sleeping gives you a turn-penalty
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed Apr 28, 2021
1 parent c430dec commit 3ceba54
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion game.z80
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ BDOS_READ_INPUT: EQU 0x0A
BDOS_OUTPUT_SINGLE_CHARACTER: EQU 0x02


; Game over if you don't win in this many turns
MAX_TURN_LIMIT: EQU 100




;********************************************************************
; Macros
;********************************************************************
Expand Down Expand Up @@ -170,7 +176,7 @@ game_loop:
; 0. Have we died?
ld hl, TURN_COUNT
ld a, (hl)
cp 50
cp MAX_TURN_LIMIT
jp c,game_loop_continue

ld hl, PLAYER_DEAD
Expand Down Expand Up @@ -1741,6 +1747,12 @@ de_delay_loop:
POP_ALL
djnz hl_delay

; Double the turn-count.
ld hl,TURN_COUNT
ld a, (hl)
add a, a
ld (hl),a

ld de, SLEEP_END_MSG
call show_msg
ret
Expand Down

0 comments on commit 3ceba54

Please sign in to comment.