]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/jamshred/game/game.factor
factor: trim using lists
[factor.git] / extra / jamshred / game / game.factor
index 1d5a9e461ebfbeee72990846570d97f4c036032a..c54a1973bd61bffb9c5c18ba13e33c3f4cee2813 100644 (file)
@@ -1,6 +1,7 @@
-! Copyright (C) 2007 Alex Chapman
+! Copyright (C) 2007, 2008 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel opengl arrays sequences jamshred.log jamshred.player jamshred.sound jamshred.tunnel math math.constants math.vectors ;
+USING: accessors arrays jamshred.player jamshred.sound
+jamshred.tunnel kernel math math.constants sequences ;
 IN: jamshred.game
 
 TUPLE: jamshred sounds tunnel players running quit ;
@@ -29,10 +30,12 @@ TUPLE: jamshred sounds tunnel players running quit ;
 : mouse-moved ( x-radians y-radians jamshred -- )
     jamshred-player -rot turn-player ;
 
-: mouse-units-per-full-roll ( -- n ) 50 ;
+CONSTANT: units-per-full-roll 50
 
-: mouse-scroll-x ( jamshred x -- )
-    [ jamshred-player ] dip 2 pi * * mouse-units-per-full-roll / roll-player ;
+: jamshred-roll ( jamshred n -- )
+    [ jamshred-player ] dip 2 pi * * units-per-full-roll / roll-player ;
+
+: mouse-scroll-x ( jamshred x -- ) jamshred-roll ;
 
 : mouse-scroll-y ( jamshred y -- )
     neg swap jamshred-player change-player-speed ;