diff --git a/examples/star-seeker/README.md b/examples/star-seeker/README.md new file mode 100644 index 000000000..ea9da8fea --- /dev/null +++ b/examples/star-seeker/README.md @@ -0,0 +1 @@ +Show how to use the "Ellipse movement" extension to move a player in a snake-like game. \ No newline at end of file diff --git a/examples/star-seeker/assets/Red playerShip (1).png b/examples/star-seeker/assets/Red playerShip (1).png new file mode 100644 index 000000000..213f1be09 Binary files /dev/null and b/examples/star-seeker/assets/Red playerShip (1).png differ diff --git a/examples/star-seeker/assets/Silver star.png b/examples/star-seeker/assets/Silver star.png new file mode 100644 index 000000000..e07a55e98 Binary files /dev/null and b/examples/star-seeker/assets/Silver star.png differ diff --git a/examples/star-seeker/star-seeker.json b/examples/star-seeker/star-seeker.json new file mode 100644 index 000000000..bf31e09a0 --- /dev/null +++ b/examples/star-seeker/star-seeker.json @@ -0,0 +1,3335 @@ +{ + "firstLayout": "", + "gdVersion": { + "build": 99, + "major": 4, + "minor": 0, + "revision": 0 + }, + "properties": { + "adaptGameResolutionAtRuntime": true, + "folderProject": false, + "orientation": "landscape", + "packageName": "com.example.gamename", + "pixelsRounding": false, + "projectUuid": "be98d949-c9a0-4972-86df-1cfb5a10fea6", + "scaleMode": "linear", + "sizeOnStartupMode": "", + "templateSlug": "", + "useExternalSourceFiles": false, + "version": "1.0.0", + "name": "Star Seeker", + "description": "Show how to use the \"Ellipse movement\" extension to move a player in a snake-like game.", + "author": "", + "windowWidth": 854, + "windowHeight": 480, + "latestCompilationDirectory": "", + "maxFPS": 60, + "minFPS": 20, + "verticalSync": false, + "platformSpecificAssets": {}, + "loadingScreen": { + "backgroundColor": 0, + "backgroundFadeInDuration": 0.2, + "backgroundImageResourceName": "", + "gdevelopLogoStyle": "light", + "logoAndProgressFadeInDuration": 0.2, + "logoAndProgressLogoFadeInDelay": 0.2, + "minDuration": 1.5, + "progressBarColor": 16777215, + "progressBarHeight": 20, + "progressBarMaxWidth": 200, + "progressBarMinWidth": 40, + "progressBarWidthPercent": 30, + "showGDevelopSplash": true, + "showProgressBar": true + }, + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "categories": [], + "playableDevices": [], + "extensionProperties": [], + "platforms": [ + { + "name": "GDevelop JS platform" + } + ], + "currentPlatform": "GDevelop JS platform" + }, + "resources": { + "resources": [ + { + "alwaysLoaded": false, + "file": "assets/Red playerShip (1).png", + "kind": "image", + "metadata": "", + "name": "Red playerShip (1).png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://resources.gdevelop-app.com/assets/Space Shooter/PNG/Red playerShip (1).png", + "name": "gdevelop-asset-store" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Silver star.png", + "kind": "image", + "metadata": "", + "name": "Silver star.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://resources.gdevelop-app.com/assets/Space Shooter/PNG/Power-ups/Silver star.png", + "name": "gdevelop-asset-store" + } + } + ], + "resourceFolders": [] + }, + "objects": [], + "objectsGroups": [], + "variables": [], + "layouts": [ + { + "b": 31, + "disableInputWhenNotFocused": true, + "mangledName": "Game", + "name": "Game", + "r": 31, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 31, + "uiSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1, + "windowMask": false + }, + "objectsGroups": [], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Ship", + "persistentUuid": "dd4c94fd-46c2-4295-a91f-dd5bd83adcdc", + "width": 0, + "x": 526, + "y": 240, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Star", + "persistentUuid": "19b1ac04-5eb1-4fb7-8f16-144571aa99c6", + "width": 0, + "x": 326, + "y": 240, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 23, + "layer": "", + "name": "Score", + "persistentUuid": "ff6aac4f-385f-4c9c-b847-c59e9172a93b", + "width": 74, + "x": 400, + "y": 16, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "2b2dfbbe01d820384d341ecfa1cf553b2700019a4f78c1d6fc4c55cb4b373bf5", + "name": "Ship", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ScreenWrap", + "type": "ScreenWrap::ScreenWrap", + "HorizontalWrapping": true, + "VerticalWrapping": true, + "BorderTop": 0, + "BorderLeft": 0, + "BorderRight": 0, + "BorderBottom": 0, + "TriggerOffset": 64 + }, + { + "name": "SineMovement", + "type": "EllipseMovement::EllipseMovement", + "HorizontalSpeed": 60, + "VerticalSpeed": 60, + "HorizontalDistance": 100, + "VerticalDistance": 0, + "CenterPointX": 0, + "CenterPointY": 0, + "SineProgressX": 0, + "SineProgressY": 0, + "AmplitudeX": 100, + "AmplitudeY": 100, + "InitialDirectionAngle": -90, + "SineSpeed": 60, + "GoLeft": false, + "RotationOffset": -90, + "ShouldRotate": true, + "RadiusY": 100, + "RadiusX": 100, + "AngularVelocity": -180, + "IsTurningLeft": true, + "LoopDuration": 2, + "InitialTurningLeft": true + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": true, + "timeBetweenFrames": 0.02500000037252903, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Red playerShip (1).png", + "points": [], + "originPoint": { + "name": "origine", + "x": 50, + "y": 37 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 32, + "y": 32 + }, + { + "x": 67, + "y": 32 + }, + { + "x": 67, + "y": 64 + }, + { + "x": 32, + "y": 64 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "bbdab8c9034b00ce5a45c15bfbb3cb8300069a4f40e8567d1166970995b2f042", + "name": "Star", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": true, + "timeBetweenFrames": 0.02500000037252903, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Silver star.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 16, + "y": 16 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Score", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "0", + "font": "", + "characterSize": 20, + "color": { + "b": 170, + "g": 170, + "r": 170 + } + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "AnyKeyPressed" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "MouseButtonPressed" + }, + "parameters": [ + "", + "Left" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::ToggleTurningLeft" + }, + "parameters": [ + "Ship", + "SineMovement", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Ship", + "Star", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Star", + "=", + "RandomFloatInRange(CameraBorderLeft() + Star.Width(), CameraBorderRight() - Star.Width())", + "=", + "RandomFloatInRange(CameraBorderTop() + Star.Height(), CameraBorderBottom() - Star.Height())" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "Score", + "+", + "1" + ] + }, + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Score", + "=", + "VariableString(Score)" + ] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 0, + "ambientLightColorG": 7893896, + "ambientLightColorR": 16, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [ + { + "name": "ScreenWrap", + "type": "ScreenWrap::ScreenWrap" + }, + { + "name": "SineMovement", + "type": "EllipseMovement::EllipseMovement" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "Tristan Rhodes (tristan@victrisgames.com), Entropy", + "category": "", + "description": "By default, the borders of the wrapping area match the screen size, but they can be changed.\n\nThe teleport happens when the center of the object crosses a border. In the behavior properties, you can modify (increase or decrease) the margin used to trigger this teleport.", + "extensionNamespace": "", + "fullName": "Screen Wrap", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", + "name": "ScreenWrap", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", + "shortDescription": "Teleport objects leaving one side of the screen so that they immediately reappear on the opposite side, maintaining speed and trajectory.", + "version": "0.1.6", + "origin": { + "identifier": "ScreenWrap", + "name": "gdevelop-extension-store" + }, + "tags": [ + "screen", + "wrap", + "teleport" + ], + "authorIds": [ + "q8ubdigLvIRXLxsJDDTaokO41mc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", + "fullName": "Screen Wrap", + "name": "ScreenWrap", + "objectType": "", + "eventsFunctions": [ + { + "description": "", + "fullName": "", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "onCreated", + "private": false, + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Initialize variables (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::PropertyBorderBottom" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetBottomBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowHeight()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::PropertyBorderRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetRightBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowWidth()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "doStepPostEvents", + "private": false, + "sentence": "", + "events": [ + { + "colorB": 5, + "colorG": 117, + "colorR": 65, + "creationTime": 0, + "name": "ScreenWrap", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Move object to opposite side (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the left and right borders.", + "fullName": "Is horizontal wrapping", + "functionType": "Condition", + "getterName": "", + "group": "", + "name": "IsHorizontalWrapping", + "private": false, + "sentence": "_PARAM0_ is horizontal wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the top and bottom borders.", + "fullName": "Is vertical wrapping", + "functionType": "Condition", + "getterName": "", + "group": "", + "name": "IsVerticalWrapping", + "private": false, + "sentence": "_PARAM0_ is vertical wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the left and right borders.", + "fullName": "Enable horizontal wrapping", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "EnableHorizontalWrapping", + "private": false, + "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"EnableHorizontalWrapping\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyHorizontalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"EnableHorizontalWrapping\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyHorizontalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Value", + "longDescription": "", + "name": "EnableHorizontalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the top and bottom borders.", + "fullName": "Enable vertical wrapping", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "EnableVerticalWrapping", + "private": false, + "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"EnableVerticalWrapping\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyVerticalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"EnableVerticalWrapping\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyVerticalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Value", + "longDescription": "", + "name": "EnableVerticalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Top border (Y position).", + "fullName": "Top border", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "BorderTop", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyBorderTop()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Left border (X position).", + "fullName": "Left border", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "BorderLeft", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyBorderLeft()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Right border (X position).", + "fullName": "Right border", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "BorderRight", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyBorderRight()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Bottom border (Y position).", + "fullName": "Bottom border", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "BorderBottom", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyBorderBottom()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Number of pixels past the center where the object teleports and appears.", + "fullName": "Trigger offset", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "TriggerOffset", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyTriggerOffset()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Set top border (Y position).", + "fullName": "Set top border", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetTopBorder", + "private": false, + "sentence": "Set _PARAM0_ top border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyBorderTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Top border value", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set left border (X position).", + "fullName": "Set left border", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetLeftBorder", + "private": false, + "sentence": "Set _PARAM0_ left border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyBorderLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Left border value", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set bottom border (Y position).", + "fullName": "Set bottom border", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetBottomBorder", + "private": false, + "sentence": "Set _PARAM0_ bottom border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyBorderBottom" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Bottom border value", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set right border (X position).", + "fullName": "Set right border", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetRightBorder", + "private": false, + "sentence": "Set _PARAM0_ right border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyBorderRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Right border value", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set trigger offset (pixels).", + "fullName": "Set trigger offset", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetTriggerOffset", + "private": false, + "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetPropertyTriggerOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "SetScreen Offset Leaving Value", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "Horizontal wrapping", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HorizontalWrapping" + }, + { + "value": "true", + "type": "Boolean", + "label": "Vertical wrapping", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "VerticalWrapping" + }, + { + "value": "0", + "type": "Number", + "label": "Top border of wrapped area (Y). If blank, the value will be 0.", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "BorderTop" + }, + { + "value": "0", + "type": "Number", + "label": "Left border of wrapped area (X). If blank, the value will be 0.", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "BorderLeft" + }, + { + "value": "0", + "type": "Number", + "label": "Right border of wrapped area (X). If blank, the value will be the scene width.", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "BorderRight" + }, + { + "value": "0", + "type": "Number", + "label": "Bottom border of wrapped area (Y). If blank, the value will be scene height.", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "BorderBottom" + }, + { + "value": "0", + "type": "Number", + "label": "Number of pixels past the center where the object teleports and appears", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "TriggerOffset" + } + ] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "@4ian, Tristan Rhodes (https://victrisgames.itch.io/)", + "category": "Movement", + "description": "It allows objects to move:\n- on an ellipsis or arcs\n- smoothly vertically or horizontally (by setting one radius to 0)\n- on a sine wave (by adding a force)\n\nIt can be used for:\n- Making objects float, such as powerups or coins\n- Moving platforms\n- Enemy movement patterns\n- Making a player constantly turn right or left", + "extensionNamespace": "", + "fullName": "Ellipse movement", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNpbmUtd2F2ZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDIxQzEzLjUsMjEgMTIuMzEsMTYuNzYgMTEuMDUsMTIuMjhDMTAuMTQsOS4wNCA5LDUgNy41LDVDNC4xMSw1IDQsMTEuOTMgNCwxMkgyQzIsMTEuNjMgMi4wNiwzIDcuNSwzQzEwLjUsMyAxMS43MSw3LjI1IDEyLjk3LDExLjc0QzEzLjgzLDE0LjggMTUsMTkgMTYuNSwxOUMxOS45NCwxOSAyMC4wMywxMi4wNyAyMC4wMywxMkgyMi4wM0MyMi4wMywxMi4zNyAyMS45NywyMSAxNi41LDIxWiIgLz48L3N2Zz4=", + "name": "EllipseMovement", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sine-wave.svg", + "shortDescription": "Move objects on ellipses or smoothly back and forth in one direction.", + "version": "1.0.0", + "origin": { + "identifier": "EllipseMovement", + "name": "gdevelop-extension-store" + }, + "tags": [ + "sine", + "ellipse", + "movement", + "circular", + "circle", + "floating", + "platform", + "enemy" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Move objects on ellipses or smoothly back and forth in one direction.", + "fullName": "Ellipse movement", + "name": "EllipseMovement", + "objectType": "", + "eventsFunctions": [ + { + "description": "", + "fullName": "", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "onCreated", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.X()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Evaluate the center of movement from the object position and properties.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyInitialTurningLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "*", + "-1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyInitialDirectionAngle() + 90" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyInitialDirectionAngle() - 90" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.X() - Object.Behavior::DeltaX()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y() - Object.Behavior::DeltaY()" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "doStepPreEvents", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update the center when the object is moved outside of the behavior.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.X() - Object.Behavior::PropertyOldX()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Y() - Object.Behavior::PropertyOldY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Place the object according to the movement angle.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyRadiusX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyCenterX() + Object.Behavior::DeltaX()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyRadiusY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyCenterY() + Object.Behavior::DeltaY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyShouldRotate" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::DirectionAngle() + Object.Behavior::PropertyRotationOffset()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save the position to detect when the object is moved outside of the behavior.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.X()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y()" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "doStepPostEvents", + "private": false, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update the movement angle for the next frame.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "360 * TimeDelta() / Object.Behavior::PropertyLoopDuration()" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the turning direction (left or right).", + "fullName": "Turn the other way", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "ToggleTurningLeft", + "private": false, + "sentence": "_PARAM0_ turn the other way", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "2 * Object.X() - Object.Behavior::CenterX()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "2 * Object.Y() - Object.Behavior::CenterY()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "180" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "*", + "-1" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the in which side the object is turning (left or right).", + "fullName": "Turn left or right", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetTurningLeft", + "private": false, + "sentence": "_PARAM0_ turn left: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "yes", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"TurnLeft\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"TurnLeft\"" + ] + } + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::ToggleTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Turn left", + "longDescription": "", + "name": "TurnLeft", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is turning left.", + "fullName": "Is turning left", + "functionType": "Condition", + "getterName": "", + "group": "", + "name": "IsTurningLeft", + "private": false, + "sentence": "_PARAM0_ is turning left", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the movement angle of the object.", + "fullName": "Movement angle", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "MovementAngle", + "private": false, + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMovementAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the loop duration (in seconds).", + "fullName": "Loop duration", + "functionType": "Expression", + "getterName": "", + "group": "Configuration", + "name": "LoopDuration", + "private": false, + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "abs(Object.Behavior::PropertyLoopDuration())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the ellipse radius on X axis.", + "fullName": "Radius X", + "functionType": "Expression", + "getterName": "", + "group": "Configuration", + "name": "RadiusX", + "private": false, + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyRadiusX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the ellipse radius on X axis.", + "fullName": "Radius Y", + "functionType": "Expression", + "getterName": "", + "group": "Configuration", + "name": "RadiusY", + "private": false, + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyRadiusY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the movement center position on X axis.", + "fullName": "Movement center X", + "functionType": "Expression", + "getterName": "", + "group": "Configuration", + "name": "CenterX", + "private": false, + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCenterX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the movement center position on Y axis.", + "fullName": "Movement center Y", + "functionType": "Expression", + "getterName": "", + "group": "Configuration", + "name": "CenterY", + "private": false, + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCenterY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the radius on X axis of the movement.", + "fullName": "Radius X", + "functionType": "Action", + "getterName": "", + "group": "Elliptical movement configuration", + "name": "SetRadiusX", + "private": false, + "sentence": "Change the radius on X axis of the movement of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Radius X", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the radius on Y axis of the movement.", + "fullName": "Radius Y", + "functionType": "Action", + "getterName": "", + "group": "Elliptical movement configuration", + "name": "SetRadiusY", + "private": false, + "sentence": "Change the radius on Y axis of the movement of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Radius Y", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the loop duration.", + "fullName": "Loop duration", + "functionType": "Action", + "getterName": "", + "group": "Elliptical movement configuration", + "name": "SetLoopDuration", + "private": false, + "sentence": "Change the loop duration of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "-GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Speed (in degrees per second)", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the movement angle. The object is teleported according to the angle.", + "fullName": "Teleport at an angle", + "functionType": "Action", + "getterName": "", + "group": "", + "name": "SetMovementAngle", + "private": false, + "sentence": "Teleport _PARAM0_ on the ellipse at _PARAM2_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Movement angle", + "longDescription": "", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "Delta X", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "DeltaX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "cos(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "Delta Y", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "DeltaY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sin(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "Direction angle", + "functionType": "Expression", + "getterName": "", + "group": "", + "name": "DirectionAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMovementAngle() + 90" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMovementAngle() - 90" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "Object", + "longDescription": "", + "name": "Object", + "type": "object" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "Behavior", + "longDescription": "", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "100", + "type": "Number", + "label": "Radius of the movement on X axis (0 to deactivate)", + "description": "", + "group": "Ellipse", + "extraInformation": [], + "hidden": false, + "name": "RadiusX" + }, + { + "value": "0", + "type": "Number", + "label": "Radius of the movement on Y axis (0 to deactivate)", + "description": "", + "group": "Ellipse", + "extraInformation": [], + "hidden": false, + "name": "RadiusY" + }, + { + "value": "6", + "type": "Number", + "label": "Loop duration (in seconds)", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "LoopDuration" + }, + { + "value": "", + "type": "Boolean", + "label": "Turn left", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "InitialTurningLeft" + }, + { + "value": "", + "type": "Number", + "label": "Initial direction (in degree)", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "InitialDirectionAngle" + }, + { + "value": "", + "type": "Boolean", + "label": "Rotate", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "ShouldRotate" + }, + { + "value": "0", + "type": "Number", + "label": "Rotation offset (in degree)", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "RotationOffset" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CenterX" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CenterY" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "MovementAngle" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OldX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OldY" + } + ] + } + ], + "eventsBasedObjects": [] + } + ], + "externalLayouts": [], + "externalSourceFiles": [] +} \ No newline at end of file