##// END OF EJS Templates
Fix loop examples again...
Fix loop examples again...

File last commit:

r47:fa3235d6 default
r63:9d6b47b8 default
Show More
main.ps
56 lines | 1.3 KiB | application/postscript | PostScriptLexer
(in-package txt2web.main)
;;; Game session state (saved in savegames)
;; Variables
(var *globals (create))
;; Inventory (objects)
(var *objs (create))
(var *current-location nil)
;; Game time
(var *started-at (chain *date (now)))
;; Timers
(var *timer-interval 500)
(var *timer-obj nil)
;; Games
(var *loaded-games (list))
;;; Transient state
;; ACTions
(var *acts (create))
;; Savegame data
(var *state-stash (create))
;; List of audio files being played
(var *playing (create))
;; Local variables stack (starts with an empty frame)
(var *locals (list))
;; Promise to continue running the game after menu
(var *menu-resume nil)
;;; Game data
;; Games (filename -> [locations])
(var *games (list))
;; The main (non library) game. Updated by openqst
(var *main-game nil)
;; Active locations
(var *locs (create))
(setf (@ window onload)
#'start)
(defun start ()
(#.(intern "INIT-DOM" "TXT2WEB.API"))
;; For MSECCOUNT
(setf *started-at (chain *date (now)))
;; For $COUNTER and SETTIMER
(#.(intern "SET-TIMER" "TXT2WEB.API")
*timer-interval)
;; Start the first game
(#.(intern "RUN-GAME" "TXT2WEB.API")
(chain *object (keys *games) 0))
(values))
;;; Some very common utilities (for both api and lib)
(defun by-id (id)
(chain document (get-element-by-id id)))