Sections
In PolyScript, sections are callbacks and organizational scopes. Every callback must exist inside one the proper organizational scope. The organizational scopes do nothing other than contain callbacks and optionally contain code.
In PolyScript, sections are callbacks and organizational scopes. Every callback must exist inside one the proper organizational scope. The organizational scopes do nothing other than contain callbacks and optionally contain code.
A callback section runs the code inside of it whenever a certain event happens, like when a poly is hit or when the game updates every frame.
Sections are opened by just stating its name on a lone line and closed by stating its name just the same but preceded by a backslash (\). Here, the onPolyTouch organizational section is opened and closed:
onPolyTouch
\ onPolyTouch
Callback sections can then be opened inside onPolyTouch:
onPolyTouch
grey
// code in here will run whenever a grey poly is hit in-game
\ grey
\ onPolyTouch
Here's the list of all organizational sections and the callbacks they support within them:
grey — Runs whenever a grey poly is hit.
red — Runs whenever a red poly is hit.
orange — Runs whenever a orange poly is hit.
magenta — Runs whenever a magenta poly is hit.
blue — Runs whenever a blue poly is hit.
green — Runs whenever a green poly is hit.
redOrange — Runs whenever a red-orange (tangerine) poly is hit.
purple — Runs whenever a purple poly is hit.
pink — Runs whenever a pink poly is hit.
anyPoly — Runs whenever any poly is hit.
clockPoly — Runs whenever a clock poly is hit.
tractorPoly — Runs whenever a tractor poly is hit.
nixPoly — Runs whenever a nix poly is hit.
update — Runs on every frame.
levelLoad — Runs whenever a level is loaded.
statIncrement — Runs whenever a statistic is incremented.
startLineGlow — Runs whenever the line glow pulse appears.
resetGameData — Runs whenever the player's data is reset.
startCrownAnimation — Runs whenever the crown animation at the end of the campaign plays.
recordLevelSpecificData — Runs whenever level-specific data is stored (at this time, only accuracy is saved this way).
getLevelSpecificData — Runs whenever level-specific data is fetched.
enlargeGameplay — Runs whenever the gameplay's scale factor changes.
resetAccuracy — Runs whenever the accuracy of a level is reset.
lightsFlip — Runs whenever the lights are flipped (from a lights poly or some other means).
loadCurrentPoly — Runs whenever the next poly is loaded (runs during gameplay when the player starts playing a level and when a poly is hit).
updatePolySequence — Runs whenever the poly sequence is updated (every frame while the player is playing a level).
polyTouch — Runs whenever a poly is hit.
deleteCurrentPoly — Runs whenever the current poly is deleted (after being hit or because of some other means).
missedPoly — Runs whenever a poly is missed.
resetPolySFXEffects — Runs whenever poly SFX effects (reverb, flanger, etc) are set to be properly on or off.
botHold — Runs whenever the bot holds (for hold polys).
botHoldRelease — Runs whenever the bot releases a hold.
botSinglePress — Runs whenever the bot presses a non-hold poly.