]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/game/worlds/worlds.factor
factor: trim using lists
[factor.git] / extra / game / worlds / worlds.factor
index a04ac3f1955694d9429667656b6c28271d870230..5fdc110783be0342519daf92ea36a0b6b497220a 100644 (file)
@@ -1,7 +1,8 @@
-! (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
+! Copyright (C) 2009 Joe Groff.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors audio.engine combinators concurrency.promises
+destructors game.input game.loop kernel math parser sequences
+threads ui ui.gadgets ui.gadgets.worlds vocabs.parser
 words.constant ;
 IN: game.worlds
 
@@ -78,11 +79,11 @@ M: game-world apply-world-attributes
     f swap open-window* dup promise>> ?promise drop ;
 
 : define-attributes-word ( word tuple -- )
-    [ name>> "-attributes" append create-in ] dip define-constant ;
+    [ name>> "-attributes" append create-word-in ] dip define-constant ;
 
 SYNTAX: GAME:
-    CREATE
-    game-attributes parse-main-window-attributes
+    scan-new-word
+    game-attributes parse-window-attributes
     2dup define-attributes-word
     parse-definition
-    define-main-window ;
+    [ define-window ] [ 2drop current-vocab main<< ] 3bi ;