From 4367068ba60d2899f062a03c96f1bf8723863d31 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 9 May 2009 14:31:33 -0500 Subject: [PATCH] save off the tick-slice when draw*-ing a game-world --- extra/game-worlds/game-worlds.factor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extra/game-worlds/game-worlds.factor b/extra/game-worlds/game-worlds.factor index 864bd28fc1..fa6b326fa9 100644 --- a/extra/game-worlds/game-worlds.factor +++ b/extra/game-worlds/game-worlds.factor @@ -1,14 +1,15 @@ -USING: accessors game-input game-loop kernel ui.gadgets +USING: accessors game-input game-loop kernel math ui.gadgets ui.gadgets.worlds ui.gestures ; IN: game-worlds TUPLE: game-world < world - game-loop ; + game-loop + { tick-slice float initial: 0.0 } ; GENERIC: tick-length ( world -- millis ) M: game-world draw* - nip draw-world ; + swap >>tick-slice draw-world ; M: game-world begin-world dup [ tick-length ] [ ] bi [ >>game-loop ] keep start-loop