From 2d295a1080884efa9d2acb3de7a426b13f5d2e03 Mon Sep 17 00:00:00 2001 From: nighca Date: Wed, 8 Jan 2025 16:05:55 +0800 Subject: [PATCH] update spx_defs for copilot prompt --- spx-backend/internal/copilot/spx_defs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spx-backend/internal/copilot/spx_defs.json b/spx-backend/internal/copilot/spx_defs.json index 250b8936c..ddddfa9ec 100644 --- a/spx-backend/internal/copilot/spx_defs.json +++ b/spx-backend/internal/copilot/spx_defs.json @@ -1 +1 @@ -{"game":[{"pkg":"spx","name":"backdropIndex","sample":"backdropIndex","desc":"Get the index of the current backdrop"},{"pkg":"spx","name":"backdropName","sample":"backdropName","desc":"Get the name of the current backdrop"},{"pkg":"spx","name":"broadcast","sample":"broadcast message","desc":"Broadcast a message, e.g., `broadcast \"message\"`"},{"pkg":"spx","name":"broadcast","sample":"broadcast message, wait","desc":"Broadcast a message with waiting, e.g., `broadcast \"message\", true`"},{"pkg":"spx","name":"broadcast","sample":"broadcast message, data, wait","desc":"Broadcast a message with data and waiting, e.g., `broadcast \"message\", data, true`"},{"pkg":"spx","name":"changeVolume","sample":"changeVolume dVolume","desc":"Change the volume for sounds with given volume change, e.g., `changeVolume 10`"},{"pkg":"spx","name":"exit","sample":"exit","desc":"Exit the game"},{"pkg":"spx","name":"onClick","sample":"onClick => { ... }","desc":"Listen to stage clicked"},{"pkg":"spx","name":"onKey","sample":"onKey key, => { ... }","desc":"Listen to given key pressed, e.g., `onKey KeyA => { ... }`"},{"pkg":"spx","name":"onKey","sample":"onKey keys, key => { ... }","desc":"Listen to given keys pressed (and get the key)"},{"pkg":"spx","name":"onKey","sample":"onKey keys, => { ... }","desc":"Listen to given keys pressed, e.g., `onKey [KeyA, KeyB] => { ... }`"},{"pkg":"spx","name":"onMsg","sample":"onMsg (message, data) => { ... }","desc":"Listen to any message broadcasted, get the broadcasted message and data"},{"pkg":"spx","name":"onMsg","sample":"onMsg message, => { ... }","desc":"Listen to specific message broadcasted"},{"pkg":"spx","name":"onStart","sample":"onStart => { ... }","desc":"Listen to game start"},{"pkg":"spx","name":"getWidget","sample":"getWidget(type, name)","desc":"Get the widget by given name"},{"pkg":"spx","name":"keyPressed","sample":"keyPressed(key)","desc":"Check if given key is currently pressed, e.g., `keyPressed(KeyA)`"},{"pkg":"spx","name":"mouseHitItem","sample":"mouseHitItem","desc":"Get the topmost sprite which is hit by mouse, e.g., `hitSprite, ok := mouseHitItem`"},{"pkg":"spx","name":"mousePressed","sample":"mousePressed","desc":"Check if the mouse is currently pressed"},{"pkg":"spx","name":"mouseX","sample":"mouseX","desc":"Get X position of the mouse"},{"pkg":"spx","name":"mouseY","sample":"mouseY","desc":"Get Y position of the mouse"},{"pkg":"spx","name":"nextBackdrop","sample":"nextBackdrop","desc":"Switch to the next backdrop"},{"pkg":"spx","name":"onAnyKey","sample":"onAnyKey key => { ... }","desc":"Listen to any key pressed"},{"pkg":"spx","name":"onBackdrop","sample":"onBackdrop backdrop => { ... }","desc":"Listen to backdrop switching"},{"pkg":"spx","name":"onBackdrop","sample":"onBackdrop backdrop, => { ... }","desc":"Listen to switching to specific backdrop"},{"pkg":"spx","name":"play","sample":"play sound","desc":"Play given sound, e.g., `play explosion`"},{"pkg":"spx","name":"play","sample":"play sound, wait","desc":"Play given sound with waiting, e.g., `play explosion, true`"},{"pkg":"spx","name":"play","sample":"play sound, options","desc":"Play given sound with options, e.g., `play explosion, { Loop: true }`"},{"pkg":"spx","name":"play","sample":"play soundName","desc":"Play sound with given name, e.g., `play \"explosion\"`"},{"pkg":"spx","name":"play","sample":"play soundName, wait","desc":"Play sound with given name and waiting, e.g., `play \"explosion\", true`"},{"pkg":"spx","name":"play","sample":"play soundName, options","desc":"Play sound with given name and options, e.g., `play \"explosion\", { Loop: true }`"},{"pkg":"spx","name":"prevBackdrop","sample":"prevBackdrop","desc":"Switch to the previous backdrop"},{"pkg":"spx","name":"rand","sample":"rand(from, to)","desc":"Generate a random number, e.g., `rand(1, 10)`"},{"pkg":"spx","name":"setVolume","sample":"setVolume volume","desc":"Set the volume for sounds, e.g., `setVolume 100`"},{"pkg":"spx","name":"startBackdrop","sample":"startBackdrop backdropName","desc":"Set the current backdrop by specifying name, e.g., `startBackdrop \"backdrop1\"`"},{"pkg":"spx","name":"startBackdrop","sample":"startBackdrop backdropName, wait","desc":"Set the current backdrop by specifying name, with waiting, e.g., `startBackdrop \"backdrop1\", true`"},{"pkg":"spx","name":"stopAllSounds","sample":"stopAllSounds","desc":"Stop all playing sounds"},{"pkg":"spx","name":"volume","sample":"volume","desc":"Get the volume for sounds"},{"pkg":"spx","name":"wait","sample":"wait seconds","desc":"Block current execution (coroutine) for given seconds, e.g., `wait 0.5`"}],"sprite":[{"pkg":"spx","name":"animate","sample":"animate name","desc":"Play animation with given name, e.g., `animate \"jump\"`"},{"pkg":"spx","name":"bounceOffEdge","sample":"bounceOffEdge","desc":"Check & bounce off current sprite if touching the edge"},{"pkg":"spx","name":"changeHeading","sample":"changeHeading dDirection","desc":"Change heading with given direction change, e.g., `changeHeading 90`"},{"pkg":"spx","name":"changeSize","sample":"changeSize dSize","desc":"Change the size of current sprite, e.g., `changeSize 1`"},{"pkg":"spx","name":"changeXYpos","sample":"changeXYpos dX, dY","desc":"Move with given position (X, Y) change, e.g., `changeXYpos 10, 10`"},{"pkg":"spx","name":"changeXpos","sample":"changeXpos dX","desc":"Move with given X position change, e.g., `changeXpos 10`"},{"pkg":"spx","name":"changeYpos","sample":"changeYpos dY","desc":"Move with given Y position change, e.g., `changeYpos 10`"},{"pkg":"spx","name":"clone","sample":"clone","desc":"Make a clone of current sprite, with optional data (for `onCloned` callback)"},{"pkg":"spx","name":"costumeName","sample":"costumeName","desc":"The name of the current costume"},{"pkg":"spx","name":"die","sample":"die","desc":"Let current sprite die. Animation bound to state \"die\" will be played."},{"pkg":"spx","name":"distanceTo","sample":"distanceTo(sprite)","desc":"Get the distance from current sprite to given sprite"},{"pkg":"spx","name":"distanceTo","sample":"distanceTo(spriteName)","desc":"Get the distance from current sprite to the sprite with given name, e.g., `distanceTo(\"Enemy\")`"},{"pkg":"spx","name":"distanceTo","sample":"distanceTo(obj)","desc":"Get the distance from current sprite to given object, e.g., `distanceTo(Mouse)`"},{"pkg":"spx","name":"glide","sample":"glide x, y, seconds","desc":"Move to given position (X, Y), using a glide animation"},{"pkg":"spx","name":"glide","sample":"glide sprite, seconds","desc":"Move to given sprite, using a glide animation"},{"pkg":"spx","name":"glide","sample":"glide spriteName, seconds","desc":"Move to the sprite with given name, using a glide animation"},{"pkg":"spx","name":"glide","sample":"glide obj, seconds","desc":"Move to given obj, using a glide animation, e.g., `glide Mouse, 2`"},{"pkg":"spx","name":"goto","sample":"goto sprite","desc":"Move to given sprite"},{"pkg":"spx","name":"goto","sample":"goto spriteName","desc":"Move to the sprite with given name, e.g., `goto \"Enemy\"`"},{"pkg":"spx","name":"goto","sample":"goto obj","desc":"Move to given obj, e.g., `goto Mouse`"},{"pkg":"spx","name":"heading","sample":"heading","desc":"Get current heading direction"},{"pkg":"spx","name":"hide","sample":"hide","desc":"Make current sprite invisible"},{"pkg":"spx","name":"move","sample":"move distance","desc":"Move given distance, toward current heading"},{"pkg":"spx","name":"onCloned","sample":"onCloned => { ... }","desc":"Listen to current sprite cloned"},{"pkg":"spx","name":"onMoving","sample":"onMoving => { ... }","desc":"Listen to current sprite moving (position change)"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart => { ... }","desc":"Listen to current sprite starting to be touched by any other sprites"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart sprite => { ... }","desc":"Listen to current sprite starting to be touched by any other sprites (and get the sprite)"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart spriteName, => { ... }","desc":"Listen to current sprite starting to be touched by sprite of given name"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart spriteName, sprite => { ... }","desc":"Listen to current sprite starting to be touched by sprite of given name (and get the sprite)"},{"pkg":"spx","name":"onTurning","sample":"onTurning => { ... }","desc":"Listen to current sprite turning (heading change)"},{"pkg":"spx","name":"say","sample":"say word","desc":"Make the sprite say some word, e.g., `say \"Hello!\"`"},{"pkg":"spx","name":"say","sample":"say word, seconds","desc":"Make the sprite say some word with duration, e.g., `say \"Hello!\", 2`"},{"pkg":"spx","name":"setCostume","sample":"setCostume name","desc":"Set the current costume by specifying name, e.g., `setCostume \"happy\"`"},{"pkg":"spx","name":"setHeading","sample":"setHeading direction","desc":"Set heading to given value, e.g., `setHeading Up`"},{"pkg":"spx","name":"setRotationStyle","sample":"setRotationStyle style","desc":"Set the rotation style of the sprite, e.g., `setRotationStyle LeftRight`"},{"pkg":"spx","name":"setSize","sample":"setSize size","desc":"Set the size of current sprite, e.g., `setSize 2`"},{"pkg":"spx","name":"setXYpos","sample":"setXYpos x, y","desc":"Move to given position, e.g., `setXYpos 100, 100`"},{"pkg":"spx","name":"setXpos","sample":"setXpos x","desc":"Move to given X position, e.g., `setXpos 100`"},{"pkg":"spx","name":"setYpos","sample":"setYpos y","desc":"Move to given Y position, e.g., `setYpos 100`"},{"pkg":"spx","name":"show","sample":"show","desc":"Make current sprite visible"},{"pkg":"spx","name":"size","sample":"size","desc":"Get the size of current sprite"},{"pkg":"spx","name":"onClick","sample":"onClick => { ... }","desc":"Listen to current sprite clicked"},{"pkg":"spx","name":"onKey","sample":"onKey key, => { ... }","desc":"Listen to given key pressed, e.g., `onKey KeyA => { ... }`"},{"pkg":"spx","name":"onKey","sample":"onKey keys, key => { ... }","desc":"Listen to given keys pressed (and get the key)"},{"pkg":"spx","name":"onKey","sample":"onKey keys, => { ... }","desc":"Listen to given keys pressed, e.g., `onKey [KeyA, KeyB] => { ... }`"},{"pkg":"spx","name":"onMsg","sample":"onMsg (message, data) => { ... }","desc":"Listen to any message broadcasted, get the broadcasted message and data"},{"pkg":"spx","name":"onMsg","sample":"onMsg message, => { ... }","desc":"Listen to specific message broadcasted"},{"pkg":"spx","name":"onStart","sample":"onStart => { ... }","desc":"Listen to game start"},{"pkg":"spx","name":"step","sample":"step distance","desc":"Step given distance, toward current heading. Animation bound to state \"step\" will be played"},{"pkg":"spx","name":"think","sample":"think word","desc":"Make the sprite think of some word, e.g., `think \"Wow!\"`"},{"pkg":"spx","name":"think","sample":"think word, seconds","desc":"Make the sprite think of some word with duration, e.g., `think \"Wow!\", 2`"},{"pkg":"spx","name":"touching","sample":"touching(spriteName)","desc":"Check if current sprite touching sprite with given name"},{"pkg":"spx","name":"touching","sample":"touching(sprite)","desc":"Check if current sprite touching given sprite"},{"pkg":"spx","name":"touching","sample":"touching(obj)","desc":"Check if current sprite touching given object, e.g., `touching(Mouse)`"},{"pkg":"spx","name":"turn","sample":"turn degree","desc":"Turn with given degree relative to current heading, e.g., `turn 90`"},{"pkg":"spx","name":"turn","sample":"turn direction","desc":"Turn with given direction relative to current heading, e.g., `turn Left`"},{"pkg":"spx","name":"turnTo","sample":"turnTo sprite","desc":"Turn heading to given sprite"},{"pkg":"spx","name":"turnTo","sample":"turnTo spriteName","desc":"Turn heading to given sprite by name, e.g., `turnTo \"Enemy\"`"},{"pkg":"spx","name":"turnTo","sample":"turnTo degree","desc":"Turn heading to given degree, e.g., `turnTo 90`"},{"pkg":"spx","name":"turnTo","sample":"turnTo direction","desc":"Turn heading to given direction, e.g., `turnTo Left`"},{"pkg":"spx","name":"turnTo","sample":"turnTo obj","desc":"Turn heading to given object, e.g., `turnTo Mouse`"},{"pkg":"spx","name":"visible","sample":"visible","desc":"If current sprite visible"},{"pkg":"spx","name":"xpos","sample":"xpos","desc":"Get current X position"},{"pkg":"spx","name":"ypos","sample":"ypos","desc":"Get current Y position"}],"others":[{"pkg":"spx","name":"Down","sample":"Down","desc":"Down direction"},{"pkg":"spx","name":"Edge","sample":"Edge","desc":"Any edge"},{"pkg":"spx","name":"EdgeBottom","sample":"EdgeBottom","desc":"Bottom edge"},{"pkg":"spx","name":"EdgeLeft","sample":"EdgeLeft","desc":"Left edge"},{"pkg":"spx","name":"EdgeRight","sample":"EdgeRight","desc":"Right edge"},{"pkg":"spx","name":"EdgeTop","sample":"EdgeTop","desc":"Top edge"},{"pkg":"spx","name":"Left","sample":"Left","desc":"Left direction"},{"pkg":"spx","name":"LeftRight","sample":"LeftRight","desc":"Left-Right"},{"pkg":"spx","name":"Mouse","sample":"Mouse","desc":"Mouse"},{"pkg":"spx","name":"Next","sample":"Next","desc":"Next item"},{"pkg":"spx","name":"None","sample":"None","desc":"Don't Rotate"},{"pkg":"spx","name":"Normal","sample":"Normal","desc":"Normal"},{"pkg":"spx","name":"PlayContinue","sample":"PlayContinue","desc":"Continue"},{"pkg":"spx","name":"PlayPause","sample":"PlayPause","desc":"Pause"},{"pkg":"spx","name":"PlayResume","sample":"PlayResume","desc":"Resume"},{"pkg":"spx","name":"PlayRewind","sample":"PlayRewind","desc":"Rewind"},{"pkg":"spx","name":"PlayStop","sample":"PlayStop","desc":"Stop"},{"pkg":"spx","name":"Prev","sample":"Prev","desc":"Previous item"},{"pkg":"spx","name":"Right","sample":"Right","desc":"Right direction"},{"pkg":"spx","name":"Up","sample":"Up","desc":"Up direction"}],"keys":{"pkg":"spx","names":"Key0,Key1,Key2,Key3,Key4,Key5,Key6,Key7,Key8,Key9,KeyA,KeyB,KeyC,KeyD,KeyE,KeyF,KeyG,KeyH,KeyI,KeyJ,KeyK,KeyL,KeyM,KeyN,KeyO,KeyP,KeyQ,KeyR,KeyS,KeyT,KeyU,KeyV,KeyW,KeyX,KeyY,KeyZ,KeyApostrophe,KeyBackslash,KeyBackspace,KeyCapsLock,KeyComma,KeyDelete,KeyDown,KeyEnd,KeyEnter,KeyEqual,KeyEscape,KeyF1,KeyF2,KeyF3,KeyF4,KeyF5,KeyF6,KeyF7,KeyF8,KeyF9,KeyF10,KeyF11,KeyF12,KeyGraveAccent,KeyHome,KeyInsert,KeyKP0,KeyKP1,KeyKP2,KeyKP3,KeyKP4,KeyKP5,KeyKP6,KeyKP7,KeyKP8,KeyKP9,KeyKPDecimal,KeyKPDivide,KeyKPEnter,KeyKPEqual,KeyKPMultiply,KeyKPSubtract,KeyLeft,KeyLeftBracket,KeyMenu,KeyMinus,KeyNumLock,KeyPageDown,KeyPageUp,KeyPause,KeyPeriod,KeyPrintScreen,KeyRight,KeyRightBracket,KeyScrollLock,KeySemicolon,KeySlash,KeySpace,KeyTab,KeyUp,KeyAlt,KeyControl,KeyShift,KeyMax,KeyAny","sample":"onKey KeyLeft, => { ... }","desc":"Key definitions, used for keyboard event listening."}} \ No newline at end of file +{"game":[{"pkg":"spx","name":"backdropIndex","sample":"backdropIndex","desc":"Get the index of the current backdrop"},{"pkg":"spx","name":"backdropName","sample":"backdropName","desc":"Get the name of the current backdrop"},{"pkg":"spx","name":"broadcast","sample":"broadcast message","desc":"Broadcast a message, e.g., `broadcast \"message\"`"},{"pkg":"spx","name":"broadcast","sample":"broadcast message, wait","desc":"Broadcast a message with waiting, e.g., `broadcast \"message\", true`"},{"pkg":"spx","name":"broadcast","sample":"broadcast message, data, wait","desc":"Broadcast a message with data and waiting, e.g., `broadcast \"message\", data, true`"},{"pkg":"spx","name":"changeVolume","sample":"changeVolume dVolume","desc":"Change the volume for sounds with given volume change, e.g., `changeVolume 10`"},{"pkg":"spx","name":"onClick","sample":"onClick => { ... }","desc":"Listen to stage clicked"},{"pkg":"spx","name":"onKey","sample":"onKey key, => { ... }","desc":"Listen to given key pressed, e.g., `onKey KeyA => { ... }`"},{"pkg":"spx","name":"onKey","sample":"onKey keys, key => { ... }","desc":"Listen to given keys pressed (and get the key)"},{"pkg":"spx","name":"onKey","sample":"onKey keys, => { ... }","desc":"Listen to given keys pressed, e.g., `onKey [KeyA, KeyB] => { ... }`"},{"pkg":"spx","name":"onMsg","sample":"onMsg (message, data) => { ... }","desc":"Listen to any message broadcasted, get the broadcasted message and data"},{"pkg":"spx","name":"onMsg","sample":"onMsg message, => { ... }","desc":"Listen to specific message broadcasted"},{"pkg":"spx","name":"onStart","sample":"onStart => { ... }","desc":"Listen to game start"},{"pkg":"spx","name":"getWidget","sample":"getWidget(type, name)","desc":"Get the widget by given name"},{"pkg":"spx","name":"keyPressed","sample":"keyPressed(key)","desc":"Check if given key is currently pressed, e.g., `keyPressed(KeyA)`"},{"pkg":"spx","name":"mouseHitItem","sample":"mouseHitItem","desc":"Get the topmost sprite which is hit by mouse, e.g., `hitSprite, ok := mouseHitItem`"},{"pkg":"spx","name":"mousePressed","sample":"mousePressed","desc":"Check if the mouse is currently pressed"},{"pkg":"spx","name":"mouseX","sample":"mouseX","desc":"Get X position of the mouse"},{"pkg":"spx","name":"mouseY","sample":"mouseY","desc":"Get Y position of the mouse"},{"pkg":"spx","name":"nextBackdrop","sample":"nextBackdrop","desc":"Switch to the next backdrop"},{"pkg":"spx","name":"onAnyKey","sample":"onAnyKey key => { ... }","desc":"Listen to any key pressed"},{"pkg":"spx","name":"onBackdrop","sample":"onBackdrop backdrop => { ... }","desc":"Listen to backdrop switching"},{"pkg":"spx","name":"onBackdrop","sample":"onBackdrop backdrop, => { ... }","desc":"Listen to switching to specific backdrop"},{"pkg":"spx","name":"play","sample":"play sound","desc":"Play given sound, e.g., `play explosion`"},{"pkg":"spx","name":"play","sample":"play sound, wait","desc":"Play given sound with waiting, e.g., `play explosion, true`"},{"pkg":"spx","name":"play","sample":"play sound, options","desc":"Play given sound with options, e.g., `play explosion, { Loop: true }`"},{"pkg":"spx","name":"play","sample":"play soundName","desc":"Play sound with given name, e.g., `play \"explosion\"`"},{"pkg":"spx","name":"play","sample":"play soundName, wait","desc":"Play sound with given name and waiting, e.g., `play \"explosion\", true`"},{"pkg":"spx","name":"play","sample":"play soundName, options","desc":"Play sound with given name and options, e.g., `play \"explosion\", { Loop: true }`"},{"pkg":"spx","name":"prevBackdrop","sample":"prevBackdrop","desc":"Switch to the previous backdrop"},{"pkg":"spx","name":"setVolume","sample":"setVolume volume","desc":"Set the volume for sounds, e.g., `setVolume 100`"},{"pkg":"spx","name":"startBackdrop","sample":"startBackdrop backdropName","desc":"Set the current backdrop by specifying name, e.g., `startBackdrop \"backdrop1\"`"},{"pkg":"spx","name":"startBackdrop","sample":"startBackdrop backdropName, wait","desc":"Set the current backdrop by specifying name, with waiting, e.g., `startBackdrop \"backdrop1\", true`"},{"pkg":"spx","name":"stopAllSounds","sample":"stopAllSounds","desc":"Stop all playing sounds"},{"pkg":"spx","name":"volume","sample":"volume","desc":"Get the volume for sounds"},{"pkg":"spx","name":"wait","sample":"wait seconds","desc":"Block current execution (coroutine) for given seconds, e.g., `wait 0.5`"}],"sprite":[{"pkg":"spx","name":"animate","sample":"animate name","desc":"Play animation with given name, e.g., `animate \"jump\"`"},{"pkg":"spx","name":"bounceOffEdge","sample":"bounceOffEdge","desc":"Check & bounce off current sprite if touching the edge"},{"pkg":"spx","name":"changeHeading","sample":"changeHeading dDirection","desc":"Change heading with given direction change, e.g., `changeHeading 90`"},{"pkg":"spx","name":"changeSize","sample":"changeSize dSize","desc":"Change the size of current sprite, e.g., `changeSize 1`"},{"pkg":"spx","name":"changeXYpos","sample":"changeXYpos dX, dY","desc":"Change the sprite's position, e.g., `changeXYpos 10, 20` changing X position by 10 and Y position by 20"},{"pkg":"spx","name":"changeXpos","sample":"changeXpos dX","desc":"Change the sprite's X position, e.g., `changeXpos 10` changing X position by 10"},{"pkg":"spx","name":"changeYpos","sample":"changeYpos dY","desc":"Change the sprite's Y position, e.g., `changeYpos 10` changing Y position by 10"},{"pkg":"spx","name":"clone","sample":"clone","desc":"Make a clone of current sprite"},{"pkg":"spx","name":"clone","sample":"clone data","desc":"Make a clone of current sprite with given data, e.g., `clone 123` (you can get the data `123` by `onCloned`)"},{"pkg":"spx","name":"costumeName","sample":"costumeName","desc":"The name of the current costume"},{"pkg":"spx","name":"die","sample":"die","desc":"Let current sprite die. Animation bound to state \"die\" will be played."},{"pkg":"spx","name":"distanceTo","sample":"distanceTo(sprite)","desc":"Get the distance from current sprite to given sprite"},{"pkg":"spx","name":"distanceTo","sample":"distanceTo(spriteName)","desc":"Get the distance from current sprite to the sprite with given name, e.g., `distanceTo(\"Enemy\")`"},{"pkg":"spx","name":"distanceTo","sample":"distanceTo(obj)","desc":"Get the distance from current sprite to given object, e.g., `distanceTo(Mouse)`"},{"pkg":"spx","name":"glide","sample":"glide x, y, seconds","desc":"Move to given position (X, Y) with glide animation and given duration, e.g., `glide 100, 100, 2`"},{"pkg":"spx","name":"glide","sample":"glide sprite, seconds","desc":"Move to given sprite with glide animation and given duration, e.g., `glide Enemy, 2`"},{"pkg":"spx","name":"glide","sample":"glide spriteName, seconds","desc":"Move to the sprite with given name with glide animation and given duration, e.g., `glide \"Enemy\", 2`"},{"pkg":"spx","name":"glide","sample":"glide obj, seconds","desc":"Move to given obj with glide animation and given duration, e.g., `glide Mouse, 2`"},{"pkg":"spx","name":"goto","sample":"goto sprite","desc":"Move to given sprite, e.g., `goto Enemy`"},{"pkg":"spx","name":"goto","sample":"goto spriteName","desc":"Move to the sprite with given name, e.g., `goto \"Enemy\"`"},{"pkg":"spx","name":"goto","sample":"goto obj","desc":"Move to given obj, e.g., `goto Mouse`"},{"pkg":"spx","name":"heading","sample":"heading","desc":"Get current heading direction"},{"pkg":"spx","name":"hide","sample":"hide","desc":"Make current sprite invisible"},{"pkg":"spx","name":"move","sample":"move distance","desc":"Move given distance toward current heading, e.g., `move 10`"},{"pkg":"spx","name":"move","sample":"move distance","desc":"Move given distance toward current heading, e.g., `move 10`"},{"pkg":"spx","name":"onCloned","sample":"onCloned data => { ... }","desc":"Listen to current sprite cloned and get the data, e.g., `onCloned data => { ... }`"},{"pkg":"spx","name":"onCloned","sample":"onCloned => { ... }","desc":"Listen to current sprite cloned"},{"pkg":"spx","name":"onMoving","sample":"onMoving info => { ... }","desc":"Listen to current sprite moving (position change), and get the moving info, e.g., `onMoving info => { ... }`"},{"pkg":"spx","name":"onMoving","sample":"onMoving => { ... }","desc":"Listen to current sprite moving (position change)"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart => { ... }","desc":"Listen to current sprite starting to be touched by any other sprites"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart sprite => { ... }","desc":"Listen to current sprite starting to be touched by any other sprites (and get the sprite)"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart spriteName, => { ... }","desc":"Listen to current sprite starting to be touched by sprite of given name"},{"pkg":"spx","name":"onTouchStart","sample":"onTouchStart spriteName, sprite => { ... }","desc":"Listen to current sprite starting to be touched by sprite of given name (and get the sprite)"},{"pkg":"spx","name":"onTurning","sample":"onTurning info => { ... }","desc":"Listen to current sprite turning (heading change), and get the turning info, e.g., `onTurning info => { ... }`"},{"pkg":"spx","name":"onTurning","sample":"onTurning => { ... }","desc":"Listen to current sprite turning (heading change)"},{"pkg":"spx","name":"say","sample":"say word","desc":"Make the sprite say some word, e.g., `say \"Hello!\"`"},{"pkg":"spx","name":"say","sample":"say word, seconds","desc":"Make the sprite say some word with duration, e.g., `say \"Hello!\", 2`"},{"pkg":"spx","name":"setCostume","sample":"setCostume name","desc":"Set the current costume by specifying name, e.g., `setCostume \"happy\"`"},{"pkg":"spx","name":"setHeading","sample":"setHeading direction","desc":"Set heading to given value, e.g., `setHeading Up`"},{"pkg":"spx","name":"setRotationStyle","sample":"setRotationStyle style","desc":"Set the rotation style of the sprite, e.g., `setRotationStyle LeftRight`"},{"pkg":"spx","name":"setSize","sample":"setSize size","desc":"Set the size of current sprite, e.g., `setSize 2`"},{"pkg":"spx","name":"setXYpos","sample":"setXYpos x, y","desc":"Set the sprite's position, e.g., `setXYpos 100, 100`"},{"pkg":"spx","name":"setXpos","sample":"setXpos x","desc":"Set the sprite's X position, e.g., `setXpos 100`"},{"pkg":"spx","name":"setYpos","sample":"setYpos y","desc":"Set the sprite's Y position, e.g., `setYpos 100`"},{"pkg":"spx","name":"show","sample":"show","desc":"Make current sprite visible"},{"pkg":"spx","name":"size","sample":"size","desc":"Get the size of current sprite"},{"pkg":"spx","name":"onClick","sample":"onClick => { ... }","desc":"Listen to current sprite clicked"},{"pkg":"spx","name":"onKey","sample":"onKey key, => { ... }","desc":"Listen to given key pressed, e.g., `onKey KeyA => { ... }`"},{"pkg":"spx","name":"onKey","sample":"onKey keys, key => { ... }","desc":"Listen to given keys pressed (and get the key)"},{"pkg":"spx","name":"onKey","sample":"onKey keys, => { ... }","desc":"Listen to given keys pressed, e.g., `onKey [KeyA, KeyB] => { ... }`"},{"pkg":"spx","name":"onMsg","sample":"onMsg (message, data) => { ... }","desc":"Listen to any message broadcasted, get the broadcasted message and data"},{"pkg":"spx","name":"onMsg","sample":"onMsg message, => { ... }","desc":"Listen to specific message broadcasted"},{"pkg":"spx","name":"onStart","sample":"onStart => { ... }","desc":"Listen to game start"},{"pkg":"spx","name":"step","sample":"step distance","desc":"Step given distance toward current heading. Animation bound to state \"step\" will be played, e.g., `step 10`"},{"pkg":"spx","name":"step","sample":"step distance, animationName","desc":"Step given distance toward current heading and animation with given name will be played, e.g., `step 10, \"run\"`"},{"pkg":"spx","name":"step","sample":"step distance","desc":"Step given distance toward current heading. Animation bound to state \"step\" will be played"},{"pkg":"spx","name":"think","sample":"think word","desc":"Make the sprite think of some word, e.g., `think \"Wow!\"`"},{"pkg":"spx","name":"think","sample":"think word, seconds","desc":"Make the sprite think of some word with duration, e.g., `think \"Wow!\", 2`"},{"pkg":"spx","name":"touching","sample":"touching(spriteName)","desc":"Check if current sprite touching sprite with given name"},{"pkg":"spx","name":"touching","sample":"touching(sprite)","desc":"Check if current sprite touching given sprite"},{"pkg":"spx","name":"touching","sample":"touching(obj)","desc":"Check if current sprite touching given object, e.g., `touching(Mouse)`"},{"pkg":"spx","name":"turn","sample":"turn degree","desc":"Turn with given degree relative to current heading, e.g., `turn 90`"},{"pkg":"spx","name":"turn","sample":"turn direction","desc":"Turn with given direction relative to current heading, e.g., `turn Left`"},{"pkg":"spx","name":"turnTo","sample":"turnTo sprite","desc":"Turn heading to given sprite"},{"pkg":"spx","name":"turnTo","sample":"turnTo spriteName","desc":"Turn heading to given sprite by name, e.g., `turnTo \"Enemy\"`"},{"pkg":"spx","name":"turnTo","sample":"turnTo degree","desc":"Turn heading to given degree, e.g., `turnTo 90`"},{"pkg":"spx","name":"turnTo","sample":"turnTo direction","desc":"Turn heading to given direction, e.g., `turnTo Left`"},{"pkg":"spx","name":"turnTo","sample":"turnTo obj","desc":"Turn heading to given object, e.g., `turnTo Mouse`"},{"pkg":"spx","name":"visible","sample":"visible","desc":"If current sprite visible"},{"pkg":"spx","name":"xpos","sample":"xpos","desc":"Get current X position"},{"pkg":"spx","name":"ypos","sample":"ypos","desc":"Get current Y position"}],"others":[{"pkg":"spx","name":"Down","sample":"Down","desc":"Down direction"},{"pkg":"spx","name":"Edge","sample":"Edge","desc":"Any edge"},{"pkg":"spx","name":"EdgeBottom","sample":"EdgeBottom","desc":"Bottom edge"},{"pkg":"spx","name":"EdgeLeft","sample":"EdgeLeft","desc":"Left edge"},{"pkg":"spx","name":"EdgeRight","sample":"EdgeRight","desc":"Right edge"},{"pkg":"spx","name":"EdgeTop","sample":"EdgeTop","desc":"Top edge"},{"pkg":"spx","name":"exit","sample":"exit code","desc":"Exit the game with given code"},{"pkg":"spx","name":"exit","sample":"exit","desc":"Exit the game"},{"pkg":"spx","name":"Left","sample":"Left","desc":"Left direction"},{"pkg":"spx","name":"LeftRight","sample":"LeftRight","desc":"Left-Right"},{"pkg":"spx","name":"Mouse","sample":"Mouse","desc":"Mouse"},{"pkg":"spx","name":"Next","sample":"Next","desc":"Next item"},{"pkg":"spx","name":"None","sample":"None","desc":"Don't Rotate"},{"pkg":"spx","name":"Normal","sample":"Normal","desc":"Normal"},{"pkg":"spx","name":"PlayContinue","sample":"PlayContinue","desc":"Continue"},{"pkg":"spx","name":"PlayPause","sample":"PlayPause","desc":"Pause"},{"pkg":"spx","name":"PlayResume","sample":"PlayResume","desc":"Resume"},{"pkg":"spx","name":"PlayRewind","sample":"PlayRewind","desc":"Rewind"},{"pkg":"spx","name":"PlayStop","sample":"PlayStop","desc":"Stop"},{"pkg":"spx","name":"Prev","sample":"Prev","desc":"Previous item"},{"pkg":"spx","name":"rand","sample":"rand(from, to)","desc":"Generate a random integer, e.g., `rand(1, 10)`"},{"pkg":"spx","name":"rand","sample":"rand(from, to)","desc":"Generate a random number, e.g., `rand(1.5, 9.9)`"},{"pkg":"spx","name":"Right","sample":"Right","desc":"Right direction"},{"pkg":"spx","name":"Up","sample":"Up","desc":"Up direction"}],"keys":{"pkg":"spx","names":"Key0,Key1,Key2,Key3,Key4,Key5,Key6,Key7,Key8,Key9,KeyA,KeyB,KeyC,KeyD,KeyE,KeyF,KeyG,KeyH,KeyI,KeyJ,KeyK,KeyL,KeyM,KeyN,KeyO,KeyP,KeyQ,KeyR,KeyS,KeyT,KeyU,KeyV,KeyW,KeyX,KeyY,KeyZ,KeyApostrophe,KeyBackslash,KeyBackspace,KeyCapsLock,KeyComma,KeyDelete,KeyDown,KeyEnd,KeyEnter,KeyEqual,KeyEscape,KeyF1,KeyF2,KeyF3,KeyF4,KeyF5,KeyF6,KeyF7,KeyF8,KeyF9,KeyF10,KeyF11,KeyF12,KeyGraveAccent,KeyHome,KeyInsert,KeyKP0,KeyKP1,KeyKP2,KeyKP3,KeyKP4,KeyKP5,KeyKP6,KeyKP7,KeyKP8,KeyKP9,KeyKPDecimal,KeyKPDivide,KeyKPEnter,KeyKPEqual,KeyKPMultiply,KeyKPSubtract,KeyLeft,KeyLeftBracket,KeyMenu,KeyMinus,KeyNumLock,KeyPageDown,KeyPageUp,KeyPause,KeyPeriod,KeyPrintScreen,KeyRight,KeyRightBracket,KeyScrollLock,KeySemicolon,KeySlash,KeySpace,KeyTab,KeyUp,KeyAlt,KeyControl,KeyShift,KeyMax,KeyAny","sample":"onKey KeyLeft, => { ... }","desc":"Key definitions, used for keyboard event listening."}} \ No newline at end of file