This script adds a poly type that, when hit, slows the next poly momentarily.
// GAMESET "PolyScript" "usingDebug" = true
// initialize variables
POLY design polytype withdata: "w" "wind" .4 .7 1.4 withcolor 0 .5 1
DEF string windOnType = "w"
DEF number windCurrent = 0
DEF number windMax = 0
DEF boolean windRunning = false
DEF boolean hitWind = false
// sections
onPolyTouch
anyPoly
FETCH polyType = "CurrentPoly" "poly" "type"
IF polyType == windOnType
DEF boolean hitWind = true
END
\ anyPoly
\ onPolyTouch
onLevelEvent
updatePolySequence
IF hitWind == true
FETCH timeCurrent = "CurrentPoly" "time" "current"
FETCH timeMax = "CurrentPoly" "time" "aim"
CALC proportion = timeCurrent / timeMax
IF proportion >= 0.5
DEF boolean hitWind = false
DEF boolean windRunning = true
DEF number windMax = timeCurrent
SOUND play "tones" "R" .7 3
GAMESET "CurrentPoly" "time" "speed" = 0
END
END
IF windRunning == true
CALC windCurrent = windCurrent + 1
CALC windTimeSpeedT = windCurrent / windMax
GAMESET "CurrentPoly" "time" "speed" = windTimeSpeedT
IF windCurrent > windMax
DEF boolean windRunning = false
CALC windCurrent = windCurrent - windMax
FETCH levelComplete = "CurrentLevel" "completed"
END
END
\ updatePolySequence
\ onLevelEvent