add real debug mode

This commit is contained in:
Nico 2021-03-19 08:45:42 +00:00
parent bbf6d78f08
commit bd12e584ab
1 changed files with 5 additions and 7 deletions

12
main.fs
View File

@ -43,10 +43,6 @@ variable count-messages-shown
\ set an initial message
S" you feel like throwing some stuff into the pool." set-message
\ FOR DEBUGGING PURPOSES - some sets that skip into the future
\ 40 devices !
\ 10 membercost !
\ any-change? leaves a -1 on the stack if any value has changed, 0 otherwise
: any-change? ( -- flag ) membercost 1 changed? devices 1 changed? message 2 changed? or or ;
\ clear-all clears the change flag on all values.
@ -112,8 +108,8 @@ S" you feel like throwing some stuff into the pool." set-message
\ TODO write debug mode. Ideally this could just be a forth console.
: debug-console
page
." Entering debug/cheat mode!"
page ;
." Entering debug/cheat mode! use `init` to restart the game."
quit ;
\ throw-device throws a device into the pool.
\ : throw-device 1 devices +! devices 1 changed ;
@ -169,4 +165,6 @@ S" you feel like throwing some stuff into the pool." set-message
: game-loop begin game-tick handle-input draw-screen 0 until ;
\ clear the screen and start the game
page hide-cursor game-loop
: init page hide-cursor game-loop ;
init