game.worlds: construct game-loop object before begin-game-world is called so begin-game-world can change it before the loop is started

db4
Joe Groff 2010-02-24 20:07:13 -08:00
parent 7de21ca8be
commit 433f0d1ea6
1 changed files with 2 additions and 3 deletions

View File

@ -44,9 +44,8 @@ PRIVATE>
M: game-world begin-world
dup use-game-input?>> [ open-game-input ] when
dup use-audio-engine?>> [ dup open-game-audio-engine >>audio-engine ] when
dup begin-game-world
dup [ tick-interval-micros>> ] [ ] bi <game-loop> [ >>game-loop ] keep start-loop
drop ;
dup [ tick-interval-micros>> ] [ ] bi <game-loop>
[ >>game-loop begin-game-world ] keep start-loop ;
M: game-world end-world
[ [ stop-loop ] when* f ] change-game-loop