Skip to content

Commit

Permalink
Make some behaviors work with more object types (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H authored Oct 4, 2024
1 parent 741670b commit 53bdac0
Show file tree
Hide file tree
Showing 14 changed files with 6,642 additions and 7,510 deletions.
9,103 changes: 4,535 additions & 4,568 deletions extensions/community/NavMeshPathfinding.json

Large diffs are not rendered by default.

168 changes: 95 additions & 73 deletions extensions/community/TopDownMovementAnimator.json

Large diffs are not rendered by default.

97 changes: 66 additions & 31 deletions extensions/reviewed/AnimatedBackAndForthMovement.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "AnimatedBackAndForthMovement",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/repeat.svg",
"shortDescription": "Make the object go on the left, then when some distance is reached, flip and go back to the right. Make sure that your object has two animations called \"GoLeft\" and \"TurnLeft\".",
"version": "0.0.2",
"version": "0.0.3",
"description": "Make the object go on the left, then when some distance is reached, flip and go back to the right. **Make sure** that your object has **two animations called \"GoLeft\" and \"TurnLeft\"**.",
"origin": {
"identifier": "AnimatedBackAndForthMovement",
Expand All @@ -23,13 +23,15 @@
"wWP8BSlAW0UP4NeaHa2LcmmDzmH2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [],
"eventsBasedBehaviors": [
{
"description": "Make the object go on the left, then when some distance is reached, flip and go back to the right. Make sure that your object has two animations called \"GoLeft\" and \"TurnLeft\".",
"fullName": "Animated Back and Forth (mirrored) Movement",
"name": "AnimatedBackAndForthMirroredMovement",
"objectType": "Sprite",
"objectType": "",
"eventsFunctions": [
{
"fullName": "",
Expand Down Expand Up @@ -76,28 +78,30 @@
"textG": 0,
"textR": 0
},
"comment": "Move the object to the left or right",
"comment2": ""
"comment": "Move the object to the left or right"
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "AnimationName"
"value": "AnimatableCapability::AnimatableBehavior::Name"
},
"parameters": [
"Object",
"Animation",
"=",
"\"GoLeft\""
]
},
{
"type": {
"inverted": true,
"value": "FlippedX"
"value": "FlippableCapability::FlippableBehavior::FlippedX"
},
"parameters": [
"Object"
"Object",
"Flippable"
]
}
],
Expand All @@ -108,7 +112,7 @@
},
"parameters": [
"Object",
"-Object.Behavior::PropertySpeedX()",
"-SpeedX",
"0",
""
]
Expand All @@ -120,19 +124,22 @@
"conditions": [
{
"type": {
"value": "AnimationName"
"value": "AnimatableCapability::AnimatableBehavior::Name"
},
"parameters": [
"Object",
"Animation",
"=",
"\"GoLeft\""
]
},
{
"type": {
"value": "FlippedX"
"value": "FlippableCapability::FlippableBehavior::FlippedX"
},
"parameters": [
"Object"
"Object",
"Flippable"
]
}
],
Expand All @@ -143,7 +150,7 @@
},
"parameters": [
"Object",
"+Object.Behavior::PropertySpeedX()",
"SpeedX",
"0",
""
]
Expand All @@ -160,8 +167,7 @@
"textG": 0,
"textR": 0
},
"comment": "If the distance \"DistanceX\" is reached, turn the object",
"comment2": ""
"comment": "If the distance \"DistanceX\" is reached, turn the object"
},
{
"type": "BuiltinCommonInstructions::Standard",
Expand All @@ -173,7 +179,7 @@
"parameters": [
"Object",
">",
"Object.Behavior::PropertyInitialX()"
"InitialX"
]
}
],
Expand All @@ -185,24 +191,27 @@
"parameters": [
"Object",
"=",
"Object.Behavior::PropertyInitialX()"
"InitialX"
]
},
{
"type": {
"value": "SetAnimationName"
"value": "AnimatableCapability::AnimatableBehavior::SetName"
},
"parameters": [
"Object",
"Animation",
"=",
"\"TurnLeft\""
]
},
{
"type": {
"value": "FlipX"
"value": "FlippableCapability::FlippableBehavior::FlipX"
},
"parameters": [
"Object",
"Flippable",
"no"
]
}
Expand All @@ -218,7 +227,7 @@
"parameters": [
"Object",
"<",
"Object.Behavior::PropertyInitialX() - Object.Behavior::PropertyDistanceX()"
"InitialX - DistanceX"
]
}
],
Expand All @@ -230,24 +239,27 @@
"parameters": [
"Object",
"=",
"Object.Behavior::PropertyInitialX() - Object.Behavior::PropertyDistanceX()"
"InitialX - DistanceX"
]
},
{
"type": {
"value": "SetAnimationName"
"value": "AnimatableCapability::AnimatableBehavior::SetName"
},
"parameters": [
"Object",
"Animation",
"=",
"\"TurnLeft\""
]
},
{
"type": {
"value": "FlipX"
"value": "FlippableCapability::FlippableBehavior::FlipX"
},
"parameters": [
"Object",
"Flippable",
"yes"
]
}
Expand All @@ -263,37 +275,41 @@
"textG": 0,
"textR": 0
},
"comment": "At the end of the turn, go back to moving to th left (or right if flipped)",
"comment2": ""
"comment": "At the end of the turn, go back to moving to th left (or right if flipped)"
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "AnimationName"
"value": "AnimatableCapability::AnimatableBehavior::Name"
},
"parameters": [
"Object",
"Animation",
"=",
"\"TurnLeft\""
]
},
{
"type": {
"value": "AnimationEnded"
"value": "AnimatableCapability::AnimatableBehavior::HasAnimationEnded"
},
"parameters": [
"Object"
"Object",
"Animation"
]
}
],
"actions": [
{
"type": {
"value": "SetAnimationName"
"value": "AnimatableCapability::AnimatableBehavior::SetName"
},
"parameters": [
"Object",
"Animation",
"=",
"\"GoLeft\""
]
}
Expand All @@ -304,7 +320,6 @@
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "Sprite",
"type": "object"
},
{
Expand All @@ -318,6 +333,28 @@
}
],
"propertyDescriptors": [
{
"value": "",
"type": "Behavior",
"label": "Animatable capability",
"description": "",
"group": "",
"extraInformation": [
"AnimatableCapability::AnimatableBehavior"
],
"name": "Animation"
},
{
"value": "",
"type": "Behavior",
"label": "Flippable capability",
"description": "",
"group": "",
"extraInformation": [
"FlippableCapability::FlippableBehavior"
],
"name": "Flippable"
},
{
"value": "200",
"type": "Number",
Expand All @@ -326,7 +363,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "SpeedX"
},
{
Expand All @@ -337,7 +373,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "DistanceX"
},
{
Expand Down
Loading

0 comments on commit 53bdac0

Please sign in to comment.