make devices screen move properly around the display

This commit is contained in:
Nico 2021-03-30 14:05:31 +01:00
parent 2fbf00ce3e
commit 80f8b9bdd1
1 changed files with 5 additions and 5 deletions

10
main.fs
View File

@ -247,20 +247,20 @@ S" you feel like throwing some stuff into the pool." set-message
inc-y ;
\ draw-actions draws a list of the actions you've unlocked.
: draw-actions
: draw-actions ( x y -- x y )
2dup at-xy
draw-members cr 1 move-right
draw-constructs cr 1 move-right
draw-members cr over move-right
draw-constructs cr over move-right
." (q)uit (without saving)"
\ add 1 to y
inc-y ;
\ clear-xy clears the x and y positions from the stack
: clear-xy ( x y -- ) drop drop ;
: clear-xy ( x y -- ) 2drop ;
\ draw-screen redraws the devices screen, but only if there's been a change.
\ ( x y -- )
: draw-devices-screen any-change? if draw-message draw-devices draw-blank draw-actions clear-xy clear-all else 2drop then ;
: draw-devices-screen any-change? if draw-message draw-devices draw-blank draw-actions clear-xy clear-all else clear-xy then ;
\ : draw-screen clear-all ;
\ main game loop