: titlec ( c -- ) textx @ texty @ 40 * + swap text-color @ rawtextc 1 textx +! ; : textline ( w r m l ) textleft @ textx ! titlec > 19 swap - textx ! titles ; : startgame ( n -- ) s" title" loadscr s" start.jor" loadjor ; : menu-opts s" New Game" :| 1 startgame |; yield s" Continue" ' noop yield s" Help" ' noop yield s" Register" ' noop yield s" Quit" ' quit yield done ; var menu-selected : menu-y ( i -- y ) 12 * 90 + ; : draw-menu 0 menu-opts each drop over menu-y texty ! over menu-selected @ = if LGREEN else WHITE then text-color ! option dup menu-selected @ = if 15 else sp then optionbg 1 + more drop ; : redraw-menu 21 11 8 72 box draw-menu ; : exec-selected 0 menu-opts each swap drop over menu-selected @ = if execute break else drop then 1 + more drop ; : menu-count 0 menu-opts each drop drop 1 + more ; : menu-select ( di -- ) menu-selected menu-count +!cycle draw-menu ; :noname fuck s" title" loadscr redraw-menu :| ^ENTER key-pressed if exec-selected then ^UP key-pressed if -1 menu-select then ^DOWN key-pressed if 1 menu-select then ^ESC key-pressed if quit then |; ' tick redefine ; checkpoint title