From 8986fa46abf495d2b3c6b1f27514c99c0f635f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Sun, 12 Mar 2023 19:13:47 +0100 Subject: [PATCH] [Goose Bomberman] Upgrade the animator behavior * Don't show in changelog --- examples/goose-bomberman/goose-bomberman.json | 60 +++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/examples/goose-bomberman/goose-bomberman.json b/examples/goose-bomberman/goose-bomberman.json index d44bb210b..ffe79593b 100644 --- a/examples/goose-bomberman/goose-bomberman.json +++ b/examples/goose-bomberman/goose-bomberman.json @@ -12766,9 +12766,9 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "abs(mod(Object.Behavior::SharedPropertyNewAnimationDirection() - Object.Behavior::PropertyAnimationDirection(), Object.Behavior::PropertyDirectionCount()))", + "abs(Object.Behavior:: DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), Object.Behavior::PropertyAnimationDirection()))", ">", - "0.5 + 0.0625" + "0.5 + 0.03125" ] } ], @@ -13114,7 +13114,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod((Object.TopDownMovement::Angle() + Object.Behavior::PropertyAngleOffset()) * Object.Behavior::PropertyDirectionCount() / 360, Object.Behavior::PropertyDirectionCount())" + "(Object.TopDownMovement::Angle() + Object.Behavior::PropertyAngleOffset()) * Object.Behavior::PropertyDirectionCount() / 360" ] } ] @@ -13139,6 +13139,58 @@ ], "objectGroups": [] }, + { + "description": "Return the difference between 2 directions.", + "fullName": "Direction dirrerence", + "functionType": "Expression", + "name": "DirectionDifference", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(mod(GetArgumentAsNumber(\"Direction\") - GetArgumentAsNumber(\"OtherDirection\"), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount() / 2, Object.Behavior::PropertyDirectionCount()) - Object.Behavior::PropertyDirectionCount() / 2" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "type": "expression" + }, + { + "description": "Other direction", + "name": "OtherDirection", + "type": "expression" + } + ], + "objectGroups": [] + }, { "description": "Change the animation direction of the object.", "fullName": "Animation direction", @@ -13172,7 +13224,7 @@ "Object", "Behavior", "=", - "round(GetArgumentAsNumber(\"Value\"))" + "mod(mod(round(GetArgumentAsNumber(\"Value\")), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount(), Object.Behavior::PropertyDirectionCount())" ] }, {