         [ call-next-method ]
     } cleave ;
 
+: start-game ( attributes -- game-world )
+    f swap open-window* ;
+
+: define-attributes-word ( word tuple -- )
+    [ name>> "-attributes" append create-in ] dip define-constant ;
+
 SYNTAX: GAME:
     CREATE
     game-attributes parse-main-window-attributes
+    2dup define-attributes-word
     parse-definition
     define-main-window ;

    [ >>game-loop begin-game-world ] keep start-loop ;

M: game-world end-world
    [ [ stop-loop ] when* f ] change-game-loop
    [ end-game-world ]
    [ audio-engine>> [ dispose ] when* ]
    [ use-game-input?>> [ close-game-input ] when ] tri ;

! (c)2009 Joe Groff bsd license
USING: accessors audio.engine combinators destructors fry
game.input game.loop generic kernel math parser sequences
threads ui ui.gadgets ui.gadgets.worlds ui.gestures words
words.constant ;
IN: game.worlds

TUPLE: game-world < world
