 : change-player-speed ( inc player -- )
     [ + speed-range clamp-to-range ] change-speed drop ;
 
+: multiply-player-speed ( n player -- )
+    [ * speed-range clamp-to-range ] change-speed drop ; 
+
 : distance-to-move ( player -- distance )
     [ speed>> ] [ last-move>> millis dup >r swap - 1000 / * r> ]
     [ (>>last-move) ] tri ;

! Copyright (C) 2007 Alex Chapman
! See http://factorcode.org/license.txt for BSD license.
USING: accessors colors jamshred.log jamshred.oint jamshred.sound jamshred.tunnel kernel math math.constants math.order math.ranges shuffle sequences system ;
IN: jamshred.player

TUPLE: player < oint name sounds tunnel nearest-segment last-move speed ;


: ?bounce ( distance-remaining player -- )
    over 0 > [
        {
            [ dup nearest-segment>> bounce ]
            [ sounds>> bang ]
            [ 3/4 swap multiply-player-speed ]
            [ (move-player) ]
        } cleave
    ] [
        2drop
    ] if ;
