From 80f8b9bdd109b6e9703f87944e6bde9bf457aa53 Mon Sep 17 00:00:00 2001 From: nihilazo Date: Tue, 30 Mar 2021 14:05:31 +0100 Subject: [PATCH] make devices screen move properly around the display --- main.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.fs b/main.fs index 703e0ea..fb04ed7 100644 --- a/main.fs +++ b/main.fs @@ -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