# tribe speed program

# ---Input Variables---
# slope : slope of terrain creature will be traversing

# ---Output Variables---
# speed : speed multiplier


max_slope = 1

if( slope > 0 )
   if( slope < max_slope )
      speed = 1 - 0.9 * slope
   else
      speed = 0
   endif
else
   # going downhill speed up slightly until the cutoff
   if( slope < -max_slope )
     speed = 0 # too steep
   else
      speed = 1 - 0.5 * slope
   endif
endif

