USING: accessors colors combinators jamshred.oint
jamshred.sound jamshred.tunnel kernel math math.order
math.vectors ranges sequences specialized-arrays
-specialized-arrays.instances.alien.c-types.float strings system ;
+strings system ;
QUALIFIED-WITH: alien.c-types c
SPECIALIZED-ARRAY: c:float
IN: jamshred.player
: almost-to-collision ( player -- distance )
distance-to-collision 0.1 - dup 0 < [ drop 0 ] when ;
-: from ( player -- radius distance-from-centre )
+: from ( player -- radius distance-from-center )
[ nearest-segment>> dup radius>> swap ] [ location>> ] bi
- distance-from-centre ;
+ distance-from-center ;
: distance-from-wall ( player -- distance ) from - ;
-: fraction-from-centre ( player -- fraction ) from swap / ;
+: fraction-from-center ( player -- fraction ) from swap / ;
: fraction-from-wall ( player -- fraction )
- fraction-from-centre 1 swap - ;
+ fraction-from-center 1 swap - ;
: update-nearest-segment2 ( heading player -- )
2dup distance-to-heading-segment-area 0 <= [