Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New extension: Start and stop rotating object events #1406

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 254 additions & 0 deletions extensions/community/StartAndStopRotating.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
{
"author": "",
"category": "Movement",
"extensionNamespace": "",
"fullName": "Start and stop rotating object events",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXJvdGF0ZS1yaWdodCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi44OSwxNS41TDE4LjMxLDE2Ljg5QzE5LjIxLDE1LjczIDE5Ljc2LDE0LjM5IDE5LjkzLDEzSDE3LjkxQzE3Ljc3LDEzLjg3IDE3LjQzLDE0LjcyIDE2Ljg5LDE1LjVNMTMsMTcuOVYxOS45MkMxNC4zOSwxOS43NSAxNS43NCwxOS4yMSAxNi45LDE4LjMxTDE1LjQ2LDE2Ljg3QzE0LjcxLDE3LjQxIDEzLjg3LDE3Ljc2IDEzLDE3LjlNMTkuOTMsMTFDMTkuNzYsOS42MSAxOS4yMSw4LjI3IDE4LjMxLDcuMTFMMTYuODksOC41M0MxNy40Myw5LjI4IDE3Ljc3LDEwLjEzIDE3LjkxLDExTTE1LjU1LDUuNTVMMTEsMVY0LjA3QzcuMDYsNC41NiA0LDcuOTIgNCwxMkM0LDE2LjA4IDcuMDUsMTkuNDQgMTEsMTkuOTNWMTcuOTFDOC4xNiwxNy40MyA2LDE0Ljk3IDYsMTJDNiw5LjAzIDguMTYsNi41NyAxMSw2LjA5VjEwTDE1LjU1LDUuNTVaIiAvPjwvc3ZnPg==",
"name": "StartAndStopRotating",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/8f2702b71903990919c3ab647d2f0544e96d8d7ec59b7b6da0650b55902675e1_rotate-right.svg",
"shortDescription": "Use events to start and stop rotating object in a similar way to permanent forces.",
"version": "1.0.0",
"description": [
"This extension adds the following events:",
"- [b]Start rotating object[/b] (Makes an object rotate until it is stopped with the \"Stop rotating object\")",
"- [b]Stop rotating object[/b] (Only works if the rotation was started using the \"Start rotating object\"",
"These events can only be used on objects with the [b]\"Start and stop rotating object events\" behavior[/b]."
],
"tags": [
"rotate"
],
"authorIds": [
"ailcUzMNagM4K6ne3UQujBn3jeq1"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [],
"eventsBasedBehaviors": [
{
"description": "Use events to start and stop rotating object in a similar way to permanent forces.",
"fullName": "Start and stop rotating object events",
"name": "StartAndStopRotating",
"objectType": "",
"eventsFunctions": [
{
"fullName": "",
"functionType": "Action",
"name": "onCreated",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "ModVarObjet"
},
"parameters": [
"Object",
"RotationSpeed",
"=",
"0"
]
},
{
"type": {
"value": "SetObjectVariableAsBoolean"
},
"parameters": [
"Object",
"IsSpinning",
""
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "StartAndStopRotating::StartAndStopRotating",
"type": "behavior"
}
],
"objectGroups": []
},
{
"description": "Start rotating the object.",
"fullName": "Start rotating the object",
"functionType": "Action",
"name": "StartRotating",
"sentence": "Start rotating _PARAM0_ at _PARAM2_ deg/s",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetObjectVariableAsBoolean"
},
"parameters": [
"Object",
"IsSpinning",
"True"
]
},
{
"type": {
"value": "Rotate"
},
"parameters": [
"Object",
"GetArgumentAsNumber(\"Speed\")",
""
]
},
{
"type": {
"value": "ModVarObjet"
},
"parameters": [
"Object",
"RotationSpeed",
"+",
"GetArgumentAsNumber(\"Speed\")"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "StartAndStopRotating::StartAndStopRotating",
"type": "behavior"
},
{
"description": "Speed",
"name": "Speed",
"type": "expression"
}
],
"objectGroups": []
},
{
"description": "Stop rotating the object.",
"fullName": "Stop rotating",
"functionType": "Action",
"name": "StopRotating",
"sentence": "Stop rotating _PARAM0_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetObjectVariableAsBoolean"
},
"parameters": [
"Object",
"IsSpinning",
""
]
},
{
"type": {
"value": "ModVarObjet"
},
"parameters": [
"Object",
"RotationSpeed",
"=",
"0"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "StartAndStopRotating::StartAndStopRotating",
"type": "behavior"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "doStepPreEvents",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "ObjectVariableAsBoolean"
},
"parameters": [
"Object",
"IsSpinning",
"True"
]
}
],
"actions": [
{
"type": {
"value": "Rotate"
},
"parameters": [
"Object",
"Object.Variable(RotationSpeed)",
""
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "StartAndStopRotating::StartAndStopRotating",
"type": "behavior"
}
],
"objectGroups": []
}
],
"propertyDescriptors": [],
"sharedPropertyDescriptors": []
}
],
"eventsBasedObjects": []
}