strip out existing garden mechanics
This commit is contained in:
parent
d134707466
commit
1406808004
23
main.fs
23
main.fs
|
@ -66,15 +66,6 @@ variable screens
|
|||
\ get-message gets the message
|
||||
: get-message ( -- addr len ) message @ message 1 cells + @ swap ;
|
||||
|
||||
\ the map! It's a character array. Every mapize entries is a new row.
|
||||
16 constant mapsize
|
||||
create map mapsize mapsize * allot
|
||||
map mapsize mapsize * 46 fill
|
||||
|
||||
\ "location" takes an x and y and returns the address of that position in the map. 0-indexed.
|
||||
: location ( x y -- a )
|
||||
mapsize * + map + ;
|
||||
|
||||
\ set an initial message
|
||||
S" you feel like throwing some stuff into the pool." set-message
|
||||
|
||||
|
@ -314,14 +305,6 @@ S" you feel like throwing some stuff into the pool." set-message
|
|||
." (g)o metal detecting! [400 Devices]"
|
||||
then inc-y ;
|
||||
|
||||
\ draw-map draws the map. TODO don't just ignore coords
|
||||
: draw-map ( x y -- x y )
|
||||
2dup at-xy
|
||||
mapsize mapsize * 0 do
|
||||
i map + c@ emit
|
||||
i 1 + mapsize mod 0= if
|
||||
cr over move-right then
|
||||
loop ;
|
||||
\ draw-actions draws a list of the actions you've unlocked.
|
||||
: draw-actions ( x y -- x y )
|
||||
2dup at-xy
|
||||
|
@ -335,13 +318,13 @@ S" you feel like throwing some stuff into the pool." set-message
|
|||
\ clear-xy clears the x and y positions from the stack
|
||||
: clear-xy ( x y -- ) 2drop ;
|
||||
|
||||
\ draw-screen redraws the devices screen, but only if there's been a change.
|
||||
\ ( x y -- )
|
||||
\ draw-devices-screen redraws the devices screen, but only if there's been a change.
|
||||
\ ( x y -- x y )
|
||||
: draw-devices-screen draw-message draw-devices draw-blank draw-actions ;
|
||||
\ : draw-screen clear-all ;
|
||||
|
||||
\ TODO draw the garden, this is a stub
|
||||
: draw-garden 2dup at-xy draw-map ;
|
||||
: draw-garden ( x y -- x y ) 2dup at-xy ." hi " ;
|
||||
|
||||
\ TODO apparently the forth-y way to do this is with a function table
|
||||
: draw-screen
|
||||
|
|
Reference in New Issue