fix tab bar
This commit is contained in:
parent
3553032a05
commit
ab77acc264
24
main.fs
24
main.fs
|
@ -97,6 +97,7 @@ S" you feel like throwing some stuff into the pool." set-message
|
||||||
|
|
||||||
: unlock-detector
|
: unlock-detector
|
||||||
100 devices can-afford? detector-unlocked @ 0= and if
|
100 devices can-afford? detector-unlocked @ 0= and if
|
||||||
|
S" Somebody is tinkering with some devices. Says they can build a metal detector. " set-message
|
||||||
-1 detector-unlocked ! then ;
|
-1 detector-unlocked ! then ;
|
||||||
|
|
||||||
\ the word unlock tests to see if any unlock conditions are matched, and unlocks them if they are.
|
\ the word unlock tests to see if any unlock conditions are matched, and unlocks them if they are.
|
||||||
|
@ -168,7 +169,8 @@ S" you feel like throwing some stuff into the pool." set-message
|
||||||
\ the word buy-detector buys the metal detector!
|
\ the word buy-detector buys the metal detector!
|
||||||
: buy-detector
|
: buy-detector
|
||||||
400 devices can-afford? if
|
400 devices can-afford? if
|
||||||
1 screens +! then ;
|
1 screens +! then
|
||||||
|
page ;
|
||||||
|
|
||||||
\ DEBUGGING STUFF
|
\ DEBUGGING STUFF
|
||||||
|
|
||||||
|
@ -193,6 +195,14 @@ S" you feel like throwing some stuff into the pool." set-message
|
||||||
|
|
||||||
\ END DEBUGGING STUFF
|
\ END DEBUGGING STUFF
|
||||||
|
|
||||||
|
\ move screen moves forward/back x screens.
|
||||||
|
: move-screen ( x -- )
|
||||||
|
screen @ + dup dup
|
||||||
|
0 >= swap screens @ <= and if
|
||||||
|
page
|
||||||
|
screen !
|
||||||
|
else drop then ;
|
||||||
|
|
||||||
\ the word devices-input contains the input cases specifically for the device counter screen.
|
\ the word devices-input contains the input cases specifically for the device counter screen.
|
||||||
: devices-input
|
: devices-input
|
||||||
case
|
case
|
||||||
|
@ -207,6 +217,8 @@ S" you feel like throwing some stuff into the pool." set-message
|
||||||
screen @ 0= if devices-input then
|
screen @ 0= if devices-input then
|
||||||
[char] q of exit-game endof
|
[char] q of exit-game endof
|
||||||
[char] D of debug-console endof
|
[char] D of debug-console endof
|
||||||
|
[char] > of 1 move-screen endof
|
||||||
|
[char] < of -1 move-screen endof
|
||||||
endcase then ;
|
endcase then ;
|
||||||
|
|
||||||
\ inc-y increments the y coordinate being drawn at.
|
\ inc-y increments the y coordinate being drawn at.
|
||||||
|
@ -307,7 +319,7 @@ S" you feel like throwing some stuff into the pool." set-message
|
||||||
|
|
||||||
\ draw-screen redraws the devices screen, but only if there's been a change.
|
\ draw-screen redraws the devices screen, but only if there's been a change.
|
||||||
\ ( x y -- )
|
\ ( x y -- )
|
||||||
: draw-devices-screen any-change? if draw-message draw-devices draw-blank draw-actions clear-xy clear-all else clear-xy then ;
|
: draw-devices-screen draw-message draw-devices draw-blank draw-actions ;
|
||||||
\ : draw-screen clear-all ;
|
\ : draw-screen clear-all ;
|
||||||
|
|
||||||
\ TODO draw the garden, this is a stub
|
\ TODO draw the garden, this is a stub
|
||||||
|
@ -321,7 +333,13 @@ S" you feel like throwing some stuff into the pool." set-message
|
||||||
endcase ;
|
endcase ;
|
||||||
|
|
||||||
\ main game loop
|
\ main game loop
|
||||||
: game-loop begin wait-tick game-tick handle-input 1 1 draw-tab-bar draw-blank draw-screen 0 until ;
|
: game-loop
|
||||||
|
begin
|
||||||
|
wait-tick game-tick handle-input
|
||||||
|
any-change? if
|
||||||
|
1 1 draw-tab-bar draw-blank draw-screen clear-xy clear-all
|
||||||
|
then
|
||||||
|
0 until ;
|
||||||
|
|
||||||
\ for use in the debugging shell
|
\ for use in the debugging shell
|
||||||
: restart page game-loop ;
|
: restart page game-loop ;
|
||||||
|
|
Reference in New Issue