diff --git a/examples/3d-platformer/3d-platformer.json b/examples/3d-platformer/3d-platformer.json index a361d34f0..0d4a71c84 100644 --- a/examples/3d-platformer/3d-platformer.json +++ b/examples/3d-platformer/3d-platformer.json @@ -1,7 +1,7 @@ { "firstLayout": "", "gdVersion": { - "build": 244, + "build": 247, "major": 5, "minor": 5, "revision": 0 @@ -388,8 +388,7 @@ "name": "rotate-screen-icon.png" } } - ], - "resourceFolders": [] + ] }, "objects": [], "objectsFolderStructure": { @@ -1805,6 +1804,16 @@ "JoystickIdentifier": "Primary", "JumpButton": "A" }, + { + "name": "PlatformerCamera3D", + "type": "PlatformerCamera3D::PlatformerCamera3D", + "PhysicsCharacter3D": "PhysicsCharacter3D", + "ThirdPersonCamera": "ThirdPersonCamera", + "IsCameraLocked": false, + "ControlKind": "Keyboard", + "Object3D": "Object3D", + "AirFollowFreeAreaBottom": 70 + }, { "name": "Player", "type": "Player::Player", @@ -2054,7 +2063,13 @@ "type": "Scene3D::Model3DObject", "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "Collectible", + "type": "Collectible::Collectible", + "Object3D": "Object3D" + } + ], "content": { "centerLocation": "ModelOrigin", "crossfadeDuration": 0, @@ -3393,181 +3408,102 @@ }, "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Barrel" - ] - }, - { - "type": { - "value": "Background::CreateObjectOnCylinder" - }, - "parameters": [ - "", - "Cloud", - "Object3D", - "Scale", - "48", - "700", - "1200", - "2500", - "8000", - "-400", - "800", - "" - ] - }, + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Game", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Coin", - "=", - "RandomFloat(360)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SteamPipe::PushCharacterUpward" + }, + "parameters": [ + "", + "Character", + "AdvancedJump3D", + "Object3D", + "PhysicsCharacter3D", + "PipeEnd", + "Object3D", + "" + ] + } ] }, - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "=", - "Character.Angle() + 90", - "", - "" - ] - } - ], - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SystemInfo::HasTouchScreen" + "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" + }, + "parameters": [ + "Character", + "PhysicsCharacter3D" + ] + }, + { + "type": { + "inverted": true, + "value": "DepartScene" }, "parameters": [ "" ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] } ], "actions": [ { "type": { - "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" + "value": "Create" }, "parameters": [ "", - "\"Touch controls\"", - "0", - "0", - "0" + "SmokeEmitter", + "Character.CenterX()", + "Character.CenterY()", + "" ] - } - ], - "events": [ + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "WalkJoystick" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "WalkJoystick", - "", - "" - ] - } + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "SmokeEmitter", + "Object3D", + "=", + "Character.Z()" ] } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" - }, - "parameters": [ - "", - "WalkJoystick", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" - }, - "parameters": [ - "WalkJoystick", - "CursorX(\"UI\")" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Camera controls", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Camera object rotates along with the player's cursor, and the in game camera rotates based on the position of the Camera object" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + "value": "Collision3D::AreWithinDistance" }, "parameters": [ - "WalkJoystick", + "", + "Character", + "Coin", + "50", + "no", "" ] } @@ -3575,26 +3511,49 @@ "actions": [ { "type": { - "value": "SetStringVariable" + "value": "Collectible::Collectible::Explode" }, "parameters": [ - "ControlKind", - "=", - "\"Touch\"" + "Coin", + "Collectible", + "CoinExplosion", + "Object3D", + "Character.Angle()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Physics3D::CollisionStarted" + }, + "parameters": [ + "Character", + "Physics3D", + "Crab", + "Physics3D", + "" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BooleanVariable" + "value": "Physics3D::IsObjectOnGivenFloor" }, "parameters": [ - "IsCameraLocked", - "False", + "Character", + "PhysicsCharacter3D", + "Crab", + "Physics3D", "" ] } @@ -3602,99 +3561,90 @@ "actions": [ { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + "value": "Crab::Flatten" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "2", + "", + "Crab", + "Animation", + "PhysicsEllipseMovement3D", + "ShakeModel3D", + "Tween3D", "" ] } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "1", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "ControlKind", - "=", - "\"Gamepad\"" - ] }, - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" - }, - "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "2", - "" - ] - } - ], - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BooleanVariable" + "value": "Physics3D::PhysicsCharacter3D::IsFalling" }, "parameters": [ - "IsCameraLocked", - "False", - "" + "Character", + "PhysicsCharacter3D" ] } ], "actions": [ { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + "value": "Crab::Flatten" + }, + "parameters": [ + "", + "Crab", + "Animation", + "PhysicsEllipseMovement3D", + "ShakeModel3D", + "Tween3D", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Player::PushBack" }, "parameters": [ + "", "Character", - "ThirdPersonCamera", - "=", - "2", + "PhysicsCharacter3D", + "Crab", + "600", + "400", "" ] } ] } ] - }, + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "UI", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "AnyKeyPressed" + "value": "DepartScene" }, "parameters": [ "" @@ -3704,23 +3654,40 @@ "actions": [ { "type": { - "value": "SetStringVariable" + "value": "Cache" }, "parameters": [ - "ControlKind", - "=", - "\"Keyboard\"" + "Barrel" ] }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + "value": "Background::CreateObjectOnCylinder" }, "parameters": [ - "Character", - "ThirdPersonCamera", + "", + "Cloud", + "Object3D", + "Scale", + "48", + "700", + "1200", + "2500", + "8000", + "-400", + "800", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", "=", - "2", + "Character.Angle() + 90", + "", "" ] } @@ -3731,11 +3698,9 @@ "conditions": [ { "type": { - "value": "BooleanVariable" + "value": "SystemInfo::HasTouchScreen" }, "parameters": [ - "IsCameraLocked", - "False", "" ] } @@ -3743,62 +3708,37 @@ "actions": [ { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "2", - "" + "", + "\"Touch controls\"", + "0", + "0", + "0" ] } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Not" - }, - "parameters": [], - "subInstructions": [ + ], + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "AnyKeyPressed" + "value": "Cache" }, "parameters": [ - "" + "WalkJoystick" ] }, { "type": { - "value": "Gamepads::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "1", - "\"Left\"", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" }, "parameters": [ "WalkJoystick", + "", "" ] } @@ -3806,88 +3746,31 @@ } ] } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "ControlKind", - "=", - "\"Keyboard\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" - }, - "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "1000000", - "" - ] - } - ] - }, + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "ControlKind", - "!=", - "\"Keyboard\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" - }, - "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "0.5", - "" - ] - } + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "WalkJoystick", + "\"Left\"", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsCameraLocked", - "False", - "" - ] - } + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "WalkJoystick", + "CursorX(\"UI\")" ] } ] @@ -3968,11 +3851,12 @@ { "type": { "inverted": true, - "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ - "JumpButton", - "MultitouchButton", + "", + "1", + "\"A\"", "" ] } @@ -3993,420 +3877,625 @@ }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "MousePointerLock::isPointerLocked" - }, - "parameters": [ - "", - "" - ] - }, + "conditions": [], + "actions": [ { "type": { - "value": "MousePointerLock::IsMoving" + "value": "ThirdPersonCamera::ThirdPersonCamera::MoveCameraCloser" }, "parameters": [ - "", + "Character", + "ThirdPersonCamera", "" ] } - ], + ] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 196608, + "ambientLightColorG": 0, + "ambientLightColorR": 8126128, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [ + { + "effectType": "Scene3D::DirectionalLight", + "name": "DirectionalLight", + "doubleParameters": { + "distanceFromCamera": 1500, + "elevation": 60, + "frustumSize": 4000, + "intensity": 0.75, + "minimumShadowBias": 0.0008, + "rotation": 30 + }, + "stringParameters": { + "color": "255;255;255", + "shadowQuality": "medium", + "top": "Z+" + }, + "booleanParameters": { + "isCastingShadow": true + } + }, + { + "effectType": "Scene3D::HemisphereLight", + "name": "HemisphereLight", + "doubleParameters": { + "elevation": 90, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "192;192;192", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 8908016, + "ambientLightColorG": 0, + "ambientLightColorR": 6071712, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "MobileUI", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [] + } + ], + "behaviorsSharedData": [ + { + "name": "AdvancedJump3D", + "type": "AdvancedJump3D::AdvancedJump3D" + }, + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Collectible", + "type": "Collectible::Collectible" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "MultiplayerObject", + "type": "Multiplayer::MultiplayerObjectBehavior" + }, + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton" + }, + { + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "gravityX": 0, + "gravityY": 0, + "gravityZ": -9.8, + "worldScale": 100 + }, + { + "name": "PhysicsCharacter3D", + "type": "Physics3D::PhysicsCharacter3D" + }, + { + "name": "PhysicsCharacter3DAnimator", + "type": "PhysicsCharacter3DAnimator::PhysicsCharacter3DAnimator" + }, + { + "name": "PhysicsEllipseMovement3D", + "type": "PhysicsEllipseMovement3D::PhysicsEllipseMovement3D" + }, + { + "name": "Platformer3DGamepadMapper", + "type": "Gamepads::Platformer3DGamepadMapper" + }, + { + "name": "Platformer3DKeyboardMapper", + "type": "PhysicsCharacter3DKeyMapper::Platformer3DKeyboardMapper" + }, + { + "name": "Platformer3DMultitouchMapper", + "type": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper" + }, + { + "name": "PlatformerCamera3D", + "type": "PlatformerCamera3D::PlatformerCamera3D" + }, + { + "name": "Player", + "type": "Player::Player" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Respawn3D", + "type": "Respawn3D::Respawn3D" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "ShakeModel3D", + "type": "ShakeObject3D::ShakeModel3D", + "EasingFactor": 4.2442943673e-313 + }, + { + "name": "ThirdPersonCamera", + "type": "ThirdPersonCamera::ThirdPersonCamera" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "Background", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "Background", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "Originally automatically extracted from events of the project", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "Create objects on cylinder", + "functionType": "Action", + "name": "CreateObjectOnCylinder", + "sentence": "Create _PARAM1_ _PARAM4_ times around _PARAM5_ ; _PARAM6_ at a distance from _PARAM7_ to _PARAM8_ and an elevation from _PARAM9_ to _PARAM10_", + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "ObjectCount", + "conditions": [], "actions": [ { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetCameraRotation" + "value": "Create" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "+", - "180 * MousePointerLock::MovementX() / SceneWindowWidth()", + "", + "Cloud", + "0", + "0", "" ] }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationAngleOffset" + "value": "SetAngle" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "+", - "90 * MousePointerLock::MovementY() / SceneWindowHeight()", - "" + "Cloud", + "=", + "RandomFloat(360)" ] }, { "type": { - "value": "SetBooleanVariable" + "value": "MettreAutourPos" }, "parameters": [ - "IsCameraLocked", - "True", - "" + "Cloud", + "CenterX", + "CenterY", + "RandomFloatInRange(RadiusMin, RadiusMax)", + "Cloud.Angle()" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "Gamepads::C_Controller_X_is_connected" + "value": "SetAngle" }, "parameters": [ - "", - "1", - "" + "Cloud", + "+", + "RandomFloatInRange(-15, 15)" ] }, { "type": { - "value": "Gamepads::StickForce" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ - "", - ">", - "0", - "1", - "\"Right\"", - "" + "Cloud", + "Object3D", + "=", + "RandomFloatInRange(-30, -15)" ] - } - ], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetCameraRotation" + "value": "Scene3D::Base3DBehavior::SetZ" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "+", - "180 * Gamepads::StickForceX(1, \"Right\") * TimeDelta()", - "" + "Cloud", + "Object3D", + "=", + "RandomFloatInRange(MinZ, MaxZ)" ] }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationAngleOffset" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "+", - "90 * Gamepads::StickForceY(1, \"Right\") * TimeDelta()", - "" + "Cloud", + "Scale", + "=", + "RandomFloatInRange(0.5, 2)" ] }, { "type": { - "value": "SetBooleanVariable" + "value": "ScalableCapability::ScalableBehavior::SetX" }, "parameters": [ - "IsCameraLocked", - "True", - "" + "Cloud", + "Scale", + "*", + "RandomFloatInRange(0.8, 1.25)" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "BooleanVariable" + "value": "ScalableCapability::ScalableBehavior::SetY" }, "parameters": [ - "IsCameraLocked", - "True", - "" + "Cloud", + "Scale", + "*", + "RandomFloatInRange(1, 1.25)" ] - } - ], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + "value": "Scene3D::Base3DBehavior::SetScaleZ" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "1000000", - "" + "Cloud", + "Object3D", + "*", + "RandomFloatInRange(0.8, 1.125)" ] } ] + } + ], + "parameters": [ + { + "description": "", + "name": "Cloud", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make sure the camera doesn't get upsidedown." + "description": "3D Capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capability", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Number of object to create", + "name": "ObjectCount", + "type": "expression" + }, + { + "description": "Center X", + "name": "CenterX", + "type": "expression" + }, + { + "description": "Center Y", + "name": "CenterY", + "type": "expression" + }, + { + "description": "Minimum radius", + "name": "RadiusMin", + "type": "expression" + }, + { + "description": "Maximum radius", + "name": "RadiusMax", + "type": "expression" + }, + { + "description": "Minimum Z", + "name": "MinZ", + "type": "expression" }, + { + "description": "Maximum Z", + "name": "MaxZ", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "Crab", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "Crab", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "Originally automatically extracted from events of the project", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "Flatten", + "functionType": "Action", + "name": "Flatten", + "sentence": "Flatten _PARAM1_", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" + "value": "ActivateBehavior" }, "parameters": [ - "Character", - "Object3D", - "=", - "clamp(Character.RotationY(), -90, 90)" + "Crab", + "PhysicsEllipseMovement3D", + "" ] }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationAngleOffset" + "value": "AnimatableCapability::AnimatableBehavior::PauseAnimation" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "clamp(Character.ThirdPersonCamera::ElevationAngleOffset(), -90, 90)", - "" + "Crab", + "Animation" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Let the character jumps or fells a bit before the camera follow them." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "inverted": true, - "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" + "value": "Tween3D::Tween3D::TweenStretchZ" }, "parameters": [ - "Character", - "PhysicsCharacter3D" + "Crab", + "Tween3D", + "\"Stretch\"", + "0.3", + "0.5", + "\"easeOutCubic\"", + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetFollowFreeAreaZMin" + "value": "Wait" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "70", - "" + "1.5" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" + "value": "Tween3D::Tween3D::TweenStretchZ" }, "parameters": [ - "Character", - "PhysicsCharacter3D" + "Crab", + "Tween3D", + "\"Stretch\"", + "1", + "2", + "\"elastic\"", + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetFollowFreeAreaZMin" + "value": "Wait" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "0", - "" + "0.125" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Avoid to rotate the camera more than 90° when the character goes backward." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetTargetedRotationAngle" + "value": "ShakeObject3D::ShakeModel3D::Shake" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "Character.PhysicsCharacter3D::ForwardAngle()", + "Crab", + "ShakeModel3D", + "0.75", + "0.125", + "0.75", "" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "\"s\"" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "abs(AngleDifference(90, SpriteMultitouchJoystick::StickAngle(1, \"Primary\")))", - "<", - "90" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "abs(AngleDifference(90, Gamepads::StickAngle(1, \"Left\")))", - "<", - "90" - ] - } - ] - } - ], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetTargetedRotationAngle" + "value": "Wait" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "180 - Character.PhysicsCharacter3D::ForwardAngle()", - "" + "1.25" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Avoid to rotate the camera when the character goes backward." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "ActivateBehavior" }, "parameters": [ - "abs(AngleDifference(Character.ThirdPersonCamera::TargetedRotationAngle() + 90, CameraAngle()))", - ">", - "90" + "Crab", + "PhysicsEllipseMovement3D", + "yes" ] - } - ], - "actions": [ + }, { "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + "value": "AnimatableCapability::AnimatableBehavior::PlayAnimation" }, "parameters": [ - "Character", - "ThirdPersonCamera", - "=", - "1000000", - "" + "Crab", + "Animation" ] } ] + } + ], + "parameters": [ + { + "description": "", + "name": "Crab", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::MoveCameraCloser" - }, - "parameters": [ - "Character", - "ThirdPersonCamera", - "" - ] - } - ] + "description": "", + "name": "Animation", + "supplementaryInformation": "AnimatableCapability::AnimatableBehavior", + "type": "behavior" + }, + { + "description": "", + "name": "PhysicsEllipseMovement3D", + "supplementaryInformation": "PhysicsEllipseMovement3D::PhysicsEllipseMovement3D", + "type": "behavior" + }, + { + "description": "", + "name": "ShakeModel3D", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "", + "name": "Tween3D", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" } ], - "parameters": [] - }, + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "Player", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "Player", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "Originally automatically extracted from events of the project", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Game", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "fullName": "Push back", + "functionType": "Action", + "name": "PushBack", + "sentence": "_PARAM3_ push back _PARAM1_ at speed: _PARAM4_ ; _PARAM5_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -4414,193 +4503,151 @@ "actions": [ { "type": { - "value": "Rotate" - }, - "parameters": [ - "Coin", - "45", - "" - ] - }, - { - "type": { - "value": "SteamPipe::PushCharacterUpward" + "value": "Physics3D::PhysicsCharacter3D::SetCurrentForwardSpeed" }, "parameters": [ - "", "Character", - "AdvancedJump3D", - "Object3D", "PhysicsCharacter3D", - "PipeEnd", - "Object3D", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D" + "=", + "-HorizontalSpeed" ] }, { "type": { - "inverted": true, - "value": "DepartScene" + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ - "" + "Character", + "PhysicsCharacter3D", + "=", + "Character.AngleToObject(Crab)" ] }, { "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "Create" + "value": "Physics3D::PhysicsCharacter3D::SetCurrentJumpSpeed" }, "parameters": [ - "", - "SmokeEmitter", - "Character.CenterX()", - "Character.CenterY()", - "" + "Character", + "PhysicsCharacter3D", + "+", + "VerticalSpeed" ] }, { "type": { - "value": "Scene3D::Base3DBehavior::SetZ" + "value": "Physics3D::PhysicsCharacter3D::SetCurrentFallSpeed" }, "parameters": [ - "SmokeEmitter", - "Object3D", + "Character", + "PhysicsCharacter3D", "=", - "Character.Z()" + "0" ] } ] + } + ], + "parameters": [ + { + "description": "", + "name": "Character", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Collision3D::AreWithinDistance" - }, - "parameters": [ - "", - "Character", - "Coin", - "50", - "no", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "Coin", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "CoinExplosion", - "Coin.CenterX()", - "Coin.CenterY()", - "" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetZ" - }, - "parameters": [ - "CoinExplosion", - "Object3D", - "=", - "Coin.Object3D::CenterZ()" - ] - }, - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "CoinExplosion", - "=", - "Character.Angle()" - ] - } - ] + "description": "3D physics character", + "name": "PhysicsCharacter3D", + "supplementaryInformation": "Physics3D::PhysicsCharacter3D", + "type": "behavior" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Physics3D::CollisionStarted" - }, - "parameters": [ - "Character", - "Physics3D", - "Crab", - "Physics3D", - "" - ] - } - ], - "actions": [], + "description": "", + "name": "Crab", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Horizontal speed", + "name": "HorizontalSpeed", + "type": "expression" + }, + { + "description": "Vertical speed", + "name": "VerticalSpeed", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "", + "fullName": "Player", + "name": "Player", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Physics3D::IsObjectOnGivenFloor" + "inverted": true, + "value": "Physics3D::PhysicsCharacter3D::IsJumping" }, "parameters": [ - "Character", - "PhysicsCharacter3D", - "Crab", - "Physics3D", - "" + "Object", + "PhysicsCharacter3D" ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] } ], "actions": [ { "type": { - "value": "Crab::Flatten" + "value": "Tween3D::Tween3D::TweenStretchZ" }, "parameters": [ - "", - "Crab", - "Animation", - "PhysicsEllipseMovement3D", - "ShakeModel3D", + "Object", "Tween3D", + "\"Stretch\"", + "0.67", + "0.125", + "\"easeOutCubic\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.125" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "\"Stretch\"", + "1", + "0.25", + "\"easeInOutCubic\"", "" ] } @@ -4611,26 +4658,54 @@ "conditions": [ { "type": { - "value": "Physics3D::PhysicsCharacter3D::IsFalling" + "value": "Physics3D::PhysicsCharacter3D::IsJumping" }, "parameters": [ - "Character", + "Object", "PhysicsCharacter3D" ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] } ], "actions": [ { "type": { - "value": "Crab::Flatten" + "value": "Tween3D::Tween3D::TweenStretchZ" }, "parameters": [ - "", - "Crab", - "Animation", - "PhysicsEllipseMovement3D", - "ShakeModel3D", + "Object", + "Tween3D", + "\"Stretch\"", + "1.5", + "0.15", + "\"easeOutCubic\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.15" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Object", "Tween3D", + "\"Stretch\"", + "1", + "0.2", + "\"easeInOutCubic\"", "" ] } @@ -4638,231 +4713,205 @@ }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::Z" + }, + "parameters": [ + "Object", + "Object3D", + ">", + "-100" + ] + } + ], "actions": [ { "type": { - "value": "Player::PushBack" + "value": "ActivateBehavior" }, "parameters": [ - "", - "Character", - "PhysicsCharacter3D", - "Crab", - "600", - "400", - "" + "Object", + "ThirdPersonCamera", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::Z" + }, + "parameters": [ + "Object", + "Object3D", + "<", + "-100" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::Z" + }, + "parameters": [ + "Object", + "Object3D", + "<", + "-800" + ] + } + ], + "actions": [ + { + "type": { + "value": "Respawn3D::Respawn3D::Respawn" + }, + "parameters": [ + "Object", + "Respawn3D", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "8", + "Object3D" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.0625" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "\"Unstrentch\"", + "1", + "1", + "\"elastic\"", + "" ] } ] } - ] + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "parameters": [] - } - ], - "layers": [ - { - "ambientLightColorB": 196608, - "ambientLightColorG": 0, - "ambientLightColorR": 8126128, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ + "propertyDescriptors": [ { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [ + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, { - "effectType": "Scene3D::DirectionalLight", - "name": "DirectionalLight", - "doubleParameters": { - "distanceFromCamera": 1500, - "elevation": 60, - "frustumSize": 4000, - "intensity": 0.75, - "minimumShadowBias": 0.0008, - "rotation": 30 - }, - "stringParameters": { - "color": "255;255;255", - "shadowQuality": "medium", - "top": "Z+" - }, - "booleanParameters": { - "isCastingShadow": true - } + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" }, { - "effectType": "Scene3D::HemisphereLight", - "name": "HemisphereLight", - "doubleParameters": { - "elevation": 90, - "intensity": 1, - "rotation": 0 - }, - "stringParameters": { - "groundColor": "192;192;192", - "skyColor": "255;255;255", - "top": "Z+" - }, - "booleanParameters": {} + "value": "", + "type": "Behavior", + "label": "Advanced 3D tween", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "choices": [], + "name": "Tween3D" + }, + { + "value": "", + "type": "Behavior", + "label": "Third person camera", + "extraInformation": [ + "ThirdPersonCamera::ThirdPersonCamera" + ], + "choices": [], + "name": "ThirdPersonCamera" + }, + { + "value": "", + "type": "Behavior", + "label": "3D respawn", + "extraInformation": [ + "Respawn3D::Respawn3D" + ], + "choices": [], + "name": "Respawn3D" } - ] - }, - { - "ambientLightColorB": 8908016, - "ambientLightColorG": 0, - "ambientLightColorR": 6071712, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "MobileUI", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [] + ], + "sharedPropertyDescriptors": [] } ], - "behaviorsSharedData": [ - { - "name": "AdvancedJump3D", - "type": "AdvancedJump3D::AdvancedJump3D" - }, - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior" - }, - { - "name": "Animation", - "type": "AnimatableCapability::AnimatableBehavior" - }, - { - "name": "Effect", - "type": "EffectCapability::EffectBehavior" - }, - { - "name": "Flippable", - "type": "FlippableCapability::FlippableBehavior" - }, - { - "name": "MultiplayerObject", - "type": "Multiplayer::MultiplayerObjectBehavior" - }, - { - "name": "MultitouchButton", - "type": "SpriteMultitouchJoystick::MultitouchButton" - }, - { - "name": "Object3D", - "type": "Scene3D::Base3DBehavior" - }, - { - "name": "Opacity", - "type": "OpacityCapability::OpacityBehavior" - }, - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "gravityX": 0, - "gravityY": 0, - "gravityZ": -9.8, - "worldScale": 100 - }, - { - "name": "PhysicsCharacter3D", - "type": "Physics3D::PhysicsCharacter3D" - }, - { - "name": "PhysicsCharacter3DAnimator", - "type": "PhysicsCharacter3DAnimator::PhysicsCharacter3DAnimator" - }, - { - "name": "PhysicsEllipseMovement3D", - "type": "PhysicsEllipseMovement3D::PhysicsEllipseMovement3D" - }, - { - "name": "Platformer3DGamepadMapper", - "type": "Gamepads::Platformer3DGamepadMapper" - }, - { - "name": "Platformer3DKeyboardMapper", - "type": "PhysicsCharacter3DKeyMapper::Platformer3DKeyboardMapper" - }, - { - "name": "Platformer3DMultitouchMapper", - "type": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper" - }, - { - "name": "Player", - "type": "Player::Player" - }, - { - "name": "Resizable", - "type": "ResizableCapability::ResizableBehavior" - }, - { - "name": "Respawn3D", - "type": "Respawn3D::Respawn3D" - }, - { - "name": "Scale", - "type": "ScalableCapability::ScalableBehavior" - }, - { - "name": "ShakeModel3D", - "type": "ShakeObject3D::ShakeModel3D", - "EasingFactor": 4.2442943673e-313 - }, - { - "name": "ThirdPersonCamera", - "type": "ThirdPersonCamera::ThirdPersonCamera" - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - }, - { - "name": "Tween3D", - "type": "Tween3D::Tween3D" - } - ] - } - ], - "externalEvents": [], - "eventsFunctionsExtensions": [ + "eventsBasedObjects": [] + }, { "author": "", "category": "", "extensionNamespace": "", - "fullName": "Background", + "fullName": "SteamPipe", "gdevelopVersion": "", "helpPath": "", "iconUrl": "", - "name": "Background", + "name": "SteamPipe", "previewIconUrl": "", "shortDescription": "", "version": "", @@ -4874,320 +4923,181 @@ "sceneVariables": [], "eventsFunctions": [ { - "fullName": "Create objects on cylinder", + "fullName": "Push character upward", "functionType": "Action", - "name": "CreateObjectOnCylinder", - "sentence": "Create _PARAM1_ _PARAM4_ times around _PARAM5_ ; _PARAM6_ at a distance from _PARAM7_ to _PARAM8_ and an elevation from _PARAM9_ to _PARAM10_", + "name": "PushCharacterUpward", + "sentence": "_PARAM5_ push _PARAM1_ upward", "events": [ { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "ObjectCount", - "conditions": [], - "actions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "Create" + "value": "Distance" }, "parameters": [ - "", - "Cloud", - "0", - "0", + "Character", + "PipeEnd", + "100", "" ] }, { "type": { - "value": "SetAngle" - }, - "parameters": [ - "Cloud", - "=", - "RandomFloat(360)" - ] - }, - { - "type": { - "value": "MettreAutourPos" - }, - "parameters": [ - "Cloud", - "CenterX", - "CenterY", - "RandomFloatInRange(RadiusMin, RadiusMax)", - "Cloud.Angle()" - ] - }, - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Cloud", - "+", - "RandomFloatInRange(-15, 15)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Cloud", - "Object3D", - "=", - "RandomFloatInRange(-30, -15)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetZ" + "value": "Scene3D::Base3DBehavior::Z" }, "parameters": [ - "Cloud", + "Character", "Object3D", - "=", - "RandomFloatInRange(MinZ, MaxZ)" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetValue" - }, - "parameters": [ - "Cloud", - "Scale", - "=", - "RandomFloatInRange(0.5, 2)" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetX" - }, - "parameters": [ - "Cloud", - "Scale", - "*", - "RandomFloatInRange(0.8, 1.25)" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetY" - }, - "parameters": [ - "Cloud", - "Scale", - "*", - "RandomFloatInRange(1, 1.25)" + ">", + "PipeEnd.Object3D::Z() + PipeEnd.Object3D::Depth()" ] - }, + } + ], + "actions": [ { "type": { - "value": "Scene3D::Base3DBehavior::SetScaleZ" + "value": "AdvancedJump3D::AdvancedJump3D::RemoveOneRemainingAirJump" }, "parameters": [ - "Cloud", - "Object3D", - "*", - "RandomFloatInRange(0.8, 1.125)" + "Character", + "AdvancedJump3D", + "" ] } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Cloud", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "objectList" - }, - { - "description": "3D Capability", - "name": "Object3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - }, - { - "description": "Scalable capability", - "name": "Scale", - "supplementaryInformation": "ScalableCapability::ScalableBehavior", - "type": "behavior" - }, - { - "description": "Number of object to create", - "name": "ObjectCount", - "type": "expression" - }, - { - "description": "Center X", - "name": "CenterX", - "type": "expression" - }, - { - "description": "Center Y", - "name": "CenterY", - "type": "expression" - }, - { - "description": "Minimum radius", - "name": "RadiusMin", - "type": "expression" - }, - { - "description": "Maximum radius", - "name": "RadiusMax", - "type": "expression" - }, - { - "description": "Minimum Z", - "name": "MinZ", - "type": "expression" - }, - { - "description": "Maximum Z", - "name": "MaxZ", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "Crab", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "", - "name": "Crab", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "Originally automatically extracted from events of the project", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "fullName": "Flatten", - "functionType": "Action", - "name": "Flatten", - "sentence": "Flatten _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Crab", - "PhysicsEllipseMovement3D", - "" - ] - }, - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::PauseAnimation" - }, - "parameters": [ - "Crab", - "Animation" - ] - }, - { - "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" - }, - "parameters": [ - "Crab", - "Tween3D", - "\"Stretch\"", - "0.3", - "0.5", - "\"easeOutCubic\"", - "" - ] - }, - { - "type": { - "value": "Wait" - }, - "parameters": [ - "1.5" - ] - }, - { - "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" - }, - "parameters": [ - "Crab", - "Tween3D", - "\"Stretch\"", - "1", - "2", - "\"elastic\"", - "" - ] - }, - { - "type": { - "value": "Wait" - }, - "parameters": [ - "0.125" - ] - }, - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::Shake" - }, - "parameters": [ - "Crab", - "ShakeModel3D", - "0.75", - "0.125", - "0.75", - "" - ] - }, - { - "type": { - "value": "Wait" - }, - "parameters": [ - "1.25" - ] - }, + ], + "events": [ { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Crab", - "PhysicsEllipseMovement3D", - "yes" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaZ", + "=", + "Character.Object3D::Z() - (PipeEnd.Object3D::Z() + PipeEnd.Object3D::Depth())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "DeltaZ", + "<", + "500" + ] + }, + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::CurrentJumpSpeed" + }, + "parameters": [ + "Character", + "PhysicsCharacter3D", + "<", + "1000" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Force", + "=", + "lerp(80, 0, (DeltaZ) / 500)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Force", + "*", + "Force" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetCurrentJumpSpeed" + }, + "parameters": [ + "Character", + "PhysicsCharacter3D", + "+", + "Force * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetCurrentFallSpeed" + }, + "parameters": [ + "Character", + "PhysicsCharacter3D", + "-", + "Force * TimeDelta()" + ] + } + ] + } + ], + "variables": [ + { + "name": "Force", + "type": "number", + "value": 0 + } + ] + } + ], + "variables": [ + { + "name": "DeltaZ", + "type": "number", + "value": 0 + } ] }, { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::PlayAnimation" - }, - "parameters": [ - "Crab", - "Animation" + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "ToString(Character.PhysicsCharacter3D::CurrentJumpSpeed()) + \" - \" + ToString(Character.PhysicsCharacter3D::CurrentFallSpeed())", + "\"info\"", + "" + ] + } ] } ] @@ -5196,32 +5106,38 @@ "parameters": [ { "description": "", - "name": "Crab", + "name": "Character", "supplementaryInformation": "Scene3D::Model3DObject", "type": "objectList" }, { "description": "", - "name": "Animation", - "supplementaryInformation": "AnimatableCapability::AnimatableBehavior", + "name": "AdvancedJump3D", + "supplementaryInformation": "AdvancedJump3D::AdvancedJump3D", "type": "behavior" }, { "description": "", - "name": "PhysicsEllipseMovement3D", - "supplementaryInformation": "PhysicsEllipseMovement3D::PhysicsEllipseMovement3D", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", "type": "behavior" }, { "description": "", - "name": "ShakeModel3D", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "name": "PhysicsCharacter3D", + "supplementaryInformation": "Physics3D::PhysicsCharacter3D", "type": "behavior" }, { "description": "", - "name": "Tween3D", - "supplementaryInformation": "Tween3D::Tween3D", + "name": "PipeEnd", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", "type": "behavior" } ], @@ -5235,116 +5151,26 @@ "author": "", "category": "", "extensionNamespace": "", - "fullName": "Player", + "fullName": "", "gdevelopVersion": "", "helpPath": "", "iconUrl": "", - "name": "Player", + "name": "Collectible", "previewIconUrl": "", "shortDescription": "", "version": "", - "description": "Originally automatically extracted from events of the project", + "description": "", "tags": [], "authorIds": [], "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [ - { - "fullName": "Push back", - "functionType": "Action", - "name": "PushBack", - "sentence": "_PARAM3_ push back _PARAM1_ at speed: _PARAM4_ ; _PARAM5_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetCurrentForwardSpeed" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "=", - "-HorizontalSpeed" - ] - }, - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "=", - "Character.AngleToObject(Crab)" - ] - }, - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetCurrentJumpSpeed" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "+", - "VerticalSpeed" - ] - }, - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetCurrentFallSpeed" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "=", - "0" - ] - } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Character", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "objectList" - }, - { - "description": "3D physics character", - "name": "PhysicsCharacter3D", - "supplementaryInformation": "Physics3D::PhysicsCharacter3D", - "type": "behavior" - }, - { - "description": "", - "name": "Crab", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "objectList" - }, - { - "description": "Horizontal speed", - "name": "HorizontalSpeed", - "type": "expression" - }, - { - "description": "Vertical speed", - "name": "VerticalSpeed", - "type": "expression" - } - ], - "objectGroups": [] - } - ], + "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "", - "fullName": "Player", - "name": "Player", + "description": "Rotate around itself.", + "fullName": "Collectible", + "name": "Collectible", "objectType": "", "eventsFunctions": [ { @@ -5356,16 +5182,6 @@ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ - { - "type": { - "inverted": true, - "value": "Physics3D::PhysicsCharacter3D::IsJumping" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D" - ] - }, { "type": { "value": "BuiltinCommonInstructions::Once" @@ -5376,229 +5192,115 @@ "actions": [ { "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" - }, - "parameters": [ - "Object", - "Tween3D", - "\"Stretch\"", - "0.67", - "0.125", - "\"easeOutCubic\"", - "" - ] - }, - { - "type": { - "value": "Wait" - }, - "parameters": [ - "0.125" - ] - }, - { - "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" + "value": "SetAngle" }, "parameters": [ "Object", - "Tween3D", - "\"Stretch\"", - "1", - "0.25", - "\"easeInOutCubic\"", - "" + "=", + "RandomFloat(360)" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "Physics3D::PhysicsCharacter3D::IsJumping" + "value": "Rotate" }, "parameters": [ "Object", - "PhysicsCharacter3D" + "45", + "" ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] } - ], + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Collectible::Collectible", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Replace the collectible with an explosion.", + "fullName": "Explode", + "functionType": "Action", + "name": "Explode", + "sentence": "_PARAM0_ explode into _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" + "value": "Delete" }, "parameters": [ "Object", - "Tween3D", - "\"Stretch\"", - "1.5", - "0.15", - "\"easeOutCubic\"", "" ] }, { "type": { - "value": "Wait" + "value": "Create" }, "parameters": [ - "0.15" + "", + "CoinExplosion", + "Object.CenterX()", + "Object.CenterY()", + "" ] }, { "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" + "value": "Scene3D::Base3DBehavior::SetZ" }, "parameters": [ - "Object", - "Tween3D", - "\"Stretch\"", - "1", - "0.2", - "\"easeInOutCubic\"", - "" + "CoinExplosion", + "Object3D", + "=", + "Object.Object3D::CenterZ()" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::Z" - }, - "parameters": [ - "Object", - "Object3D", - ">", - "-100" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Object", - "ThirdPersonCamera", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::Z" - }, - "parameters": [ - "Object", - "Object3D", - "<", - "-100" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Object", - "ThirdPersonCamera", - "no" - ] - } - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Collectible::Collectible", + "type": "behavior" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::Z" - }, - "parameters": [ - "Object", - "Object3D", - "<", - "-800" - ] - } - ], - "actions": [ - { - "type": { - "value": "Respawn3D::Respawn3D::Respawn" - }, - "parameters": [ - "Object", - "Respawn3D", - "" - ] - }, - { - "type": { - "value": "Tween3D::Tween3D::SetStretchZ" - }, - "parameters": [ - "Object", - "Tween3D", - "=", - "8", - "Object3D" - ] - }, - { - "type": { - "value": "Wait" - }, - "parameters": [ - "0.0625" - ] - }, - { - "type": { - "value": "Tween3D::Tween3D::TweenStretchZ" - }, - "parameters": [ - "Object", - "Tween3D", - "\"Unstrentch\"", - "1", - "1", - "\"elastic\"", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" + "description": "Coin explosion", + "name": "CoinExplosion", + "type": "objectList" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Player::Player", + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", "type": "behavior" } ], @@ -5615,46 +5317,6 @@ ], "choices": [], "name": "Object3D" - }, - { - "value": "", - "type": "Behavior", - "label": "3D physics character", - "extraInformation": [ - "Physics3D::PhysicsCharacter3D" - ], - "choices": [], - "name": "PhysicsCharacter3D" - }, - { - "value": "", - "type": "Behavior", - "label": "Advanced 3D tween", - "extraInformation": [ - "Tween3D::Tween3D" - ], - "choices": [], - "name": "Tween3D" - }, - { - "value": "", - "type": "Behavior", - "label": "Third person camera", - "extraInformation": [ - "ThirdPersonCamera::ThirdPersonCamera" - ], - "choices": [], - "name": "ThirdPersonCamera" - }, - { - "value": "", - "type": "Behavior", - "label": "3D respawn", - "extraInformation": [ - "Respawn3D::Respawn3D" - ], - "choices": [], - "name": "Respawn3D" } ], "sharedPropertyDescriptors": [] @@ -5662,250 +5324,6 @@ ], "eventsBasedObjects": [] }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "SteamPipe", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "", - "name": "SteamPipe", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "Originally automatically extracted from events of the project", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "fullName": "Push character upward", - "functionType": "Action", - "name": "PushCharacterUpward", - "sentence": "_PARAM5_ push _PARAM1_ upward", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Distance" - }, - "parameters": [ - "Character", - "PipeEnd", - "100", - "" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::Z" - }, - "parameters": [ - "Character", - "Object3D", - ">", - "PipeEnd.Object3D::Z() + PipeEnd.Object3D::Depth()" - ] - } - ], - "actions": [ - { - "type": { - "value": "AdvancedJump3D::AdvancedJump3D::RemoveOneRemainingAirJump" - }, - "parameters": [ - "Character", - "AdvancedJump3D", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaZ", - "=", - "Character.Object3D::Z() - (PipeEnd.Object3D::Z() + PipeEnd.Object3D::Depth())" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "DeltaZ", - "<", - "500" - ] - }, - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::CurrentJumpSpeed" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "<", - "1000" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Force", - "=", - "lerp(80, 0, (DeltaZ) / 500)" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Force", - "*", - "Force" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetCurrentJumpSpeed" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "+", - "Force * TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetCurrentFallSpeed" - }, - "parameters": [ - "Character", - "PhysicsCharacter3D", - "-", - "Force * TimeDelta()" - ] - } - ] - } - ], - "variables": [ - { - "name": "Force", - "type": "number", - "value": 0 - } - ] - } - ], - "variables": [ - { - "name": "DeltaZ", - "type": "number", - "value": 0 - } - ] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "ToString(Character.PhysicsCharacter3D::CurrentJumpSpeed()) + \" - \" + ToString(Character.PhysicsCharacter3D::CurrentFallSpeed())", - "\"info\"", - "" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Character", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "objectList" - }, - { - "description": "", - "name": "AdvancedJump3D", - "supplementaryInformation": "AdvancedJump3D::AdvancedJump3D", - "type": "behavior" - }, - { - "description": "", - "name": "Object3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - }, - { - "description": "", - "name": "PhysicsCharacter3D", - "supplementaryInformation": "Physics3D::PhysicsCharacter3D", - "type": "behavior" - }, - { - "description": "", - "name": "PipeEnd", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "objectList" - }, - { - "description": "", - "name": "Object3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, { "author": "", "category": "Input", @@ -6812,7 +6230,7 @@ "name": "Gamepads", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", - "version": "0.9.0", + "version": "0.9.1", "description": [ "Add support for gamepads (or other physical controllers).", "", @@ -7093,7 +6511,27 @@ " }\r", "}();\r", "\r", - "function onScenePostEvents() {\r", + "/**\r", + " * @param {gdjs.RuntimeScene} runtimeScene\r", + " */\r", + "function addFrameBeginningTaskIfNeeded(runtimeScene) {\r", + " const taskManager = runtimeScene.getAsyncTasksManager();\r", + " for (const taskWithCallback of taskManager.tasksWithCallback) {\r", + " if (taskWithCallback.asyncTask === frameBeginningTask) {\r", + " return;\r", + " }\r", + " }\r", + " // Async tasks are run before everything.\r", + " // This is a hack to make sure that button states are updated\r", + " // before mapping behavior events.\r", + " taskManager.addTask(frameBeginningTask);\r", + "}\r", + "\r", + "/**\r", + " * @param {gdjs.RuntimeScene} runtimeScene\r", + " */\r", + "function onScenePostEvents(runtimeScene) {\r", + " addFrameBeginningTaskIfNeeded(runtimeScene);\r", " /** @type {Gamepad[]} */\r", " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", " for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", @@ -7274,6 +6712,7 @@ " getGamepad,\r", " onScenePostEvents,\r", " frameBeginningTask,\r", + " addFrameBeginningTaskIfNeeded,\r", "}" ], "parameterObjects": "", @@ -7292,12 +6731,7 @@ "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "// Async tasks are run before everything.\r", - "// This is a hack to make sure that button states are updated\r", - "// before mapping behavior events.\r", - "runtimeScene.getAsyncTasksManager().addTask(gdjs._extensionController.frameBeginningTask);" - ], + "inlineCode": "gdjs._extensionController.addFrameBeginningTaskIfNeeded(runtimeScene);", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -7315,7 +6749,7 @@ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "gdjs._extensionController.onScenePostEvents();", + "gdjs._extensionController.onScenePostEvents(runtimeScene);", "" ], "parameterObjects": "", @@ -19855,7 +19289,7 @@ "functionType": "Condition", "name": "isEmulatingPointerLock", "private": true, - "sentence": "The mouse pointer is lock is emulated", + "sentence": "The mouse pointer lock is emulated", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -28412,13 +27846,13 @@ "category": "General", "extensionNamespace": "", "fullName": "3D collision", - "gdevelopVersion": "", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1pbnRlcnNlY3Rpb24iIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMy4xNCwxQTIuMTQsMi4xNCAwIDAsMCAxLDMuMTRWNUgzVjNINVYxSDMuMTRNNywxVjNIMTBWMUg3TTEyLDFWM0gxNFY1SDE2VjMuMTRDMTYsMS45NiAxNS4wNCwxIDEzLjg2LDFIMTJNMSw3VjEwSDNWN0gxTTksN0M3Ljg5LDcgNyw3Ljg5IDcsOUM3LDExLjMzIDcsMTYgNywxNkM3LDE2IDExLjU3LDE2IDEzLjg2LDE2QTIuMTQsMi4xNCAwIDAsMCAxNiwxMy44NkMxNiwxMS41NyAxNiw3IDE2LDdDMTYsNyAxMS4zMyw3IDksN00xOCw3VjlIMjBWMTFIMjJWOUMyMiw3Ljg5IDIxLjExLDcgMjAsN0gxOE05LDlIMTRWMTRIOVY5TTEsMTJWMTMuODZDMSwxNS4wNCAxLjk2LDE2IDMuMTQsMTZINVYxNEgzVjEySDFNMjAsMTNWMTZIMjJWMTNIMjBNNywxOFYyMEM3LDIxLjExIDcuODksMjIgOSwyMkgxMVYyMEg5VjE4SDdNMjAsMThWMjBIMThWMjJIMjBDMjEuMTEsMjIgMjIsMjEuMTEgMjIsMjBWMThIMjBNMTMsMjBWMjJIMTZWMjBIMTNaIiAvPjwvc3ZnPg==", "name": "Collision3D", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/7a5696a515bf40813692e118147568392a854f65f5b50750c9b9aaa967aba7df_vector-intersection.svg", "shortDescription": "Check collision and distance between 3D objects.", - "version": "0.2.0", + "version": "0.2.1", "description": "Check collision and distance between 3D objects and separate them from each other.", "origin": { "identifier": "Collision3D", @@ -28973,7 +28407,7 @@ "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ "\r", - "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", + "const otherObjects = eventsFunctionContext.getObjects(\"OtherObject\");\r", "\r", "if (objects.length > 0 && otherObjects.length > 0) {\r", " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToObject(\r", @@ -29017,7 +28451,7 @@ "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ "\r", - "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", + "const otherObjects = eventsFunctionContext.getObjects(\"OtherObject\");\r", "\r", "if (objects.length > 0 && otherObjects.length > 0) {\r", " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToObject(\r", @@ -34545,7 +33979,7 @@ "name": "ThirdPersonCamera", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Virtual Reality/94e95d2c318e1f3dc7151a351024e13c574e1e44669c6696aa107d60230073f6_Virtual Reality_3d_vision_eye_vr.svg", "shortDescription": "Move the camera to look at an object from a given distance.", - "version": "1.7.1", + "version": "1.8.0", "description": [ "Move the camera to look at an object from a given distance with a rotation and an elevation angles.", "", @@ -34571,169 +34005,137 @@ "sceneVariables": [], "eventsFunctions": [ { - "description": "Move the camera to look at a position from a distance.", - "fullName": "Look at a position from a distance (deprecated)", - "functionType": "Action", - "name": "LookFromDistanceAtPosition", - "private": true, - "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_; _PARAM2_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "=", - "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "=", - "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraZ" - }, - "parameters": [ - "", - "=", - "Distance * sin(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::TurnCameraTowardPosition" - }, - "parameters": [ - "", - "PositionX", - "PositionY", - "0", - "Layer", - "", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Position on X axis", - "name": "PositionX", - "type": "expression" - }, - { - "description": "Position on Y axis", - "name": "PositionY", - "type": "expression" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "description": "Rotation angle (around Z axis)", - "name": "RotationAngle", - "type": "expression" - }, - { - "description": "Elevation angle (around Y axis)", - "name": "ElevationAngle", - "type": "expression" - }, - { - "description": "Layer", - "name": "Layer", - "type": "layer" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera to look at an object from a distance.", - "fullName": "Look at an object from a distance (deprecated)", + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", "functionType": "Action", - "name": "LookFromDistanceAtObject", + "name": "DefineHelperClasses", "private": true, - "sentence": "Move the camera of _PARAM5_ to look at _PARAM1_ from _PARAM2_ pixels with a rotation of _PARAM3_° and an elevation of _PARAM4_°", + "sentence": "Define helper classes JavaScript code", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition" - }, - "parameters": [ - "", - "Object.CenterX()", - "Object.CenterY()", - "Distance", - "RotationAngle", - "ElevationAngle", - "Layer", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "description": "Rotation angle (around Z axis)", - "name": "RotationAngle", - "type": "expression" - }, - { - "description": "Elevation angle (around Y axis)", - "name": "ElevationAngle", - "type": "expression" - }, - { - "description": "Layer", - "name": "Layer", - "type": "layer" + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs.__thirdPersonCameraExtension) {", + " return;", + "}", + "", + "class CameraLocalBasis {", + " /** @type {gdjs.RuntimeObject} */", + " object;", + " rotationMatrix = new THREE.Matrix4();", + " forward = new THREE.Vector3();", + "", + " /**", + " * @param object {gdjs.RuntimeObject}", + " */", + " constructor(object) {", + " this.object = object;", + " }", + "", + " update() {", + " const layer = this.object.getInstanceContainer().getLayer(this.object.getLayer());", + " const threeCamera = layer.getRenderer().getThreeCamera();", + " this.rotationMatrix.makeRotationFromEuler(threeCamera.rotation);", + " const elements = this.rotationMatrix.elements;", + "", + " this.forward.set(-elements[8], elements[9], -elements[10]);", + " // Normalize them, just in case (they should generally be unit vectors).", + " this.forward.normalize();", + " }", + "}", + "", + "class ObjectLocalBasis {", + " /** @type {gdjs.RuntimeObject} */", + " object;", + " rotationMatrix = new THREE.Matrix4();", + " forward = new THREE.Vector3();", + " up = new THREE.Vector3();", + " right = new THREE.Vector3();", + "", + " /**", + " * @param object {gdjs.RuntimeObject}", + " */", + " constructor(object) {", + " this.object = object;", + " }", + "", + " update() {", + " const threeObject = this.object.get3DRendererObject();", + " this.rotationMatrix.makeRotationFromEuler(threeObject.rotation);", + " const elements = this.rotationMatrix.elements;", + "", + " this.up.set(elements[8], elements[9], elements[10]);", + " this.forward.set(elements[0], elements[1], elements[2]);", + " this.right.crossVectors(this.forward, this.up);", + "", + " // Normalize them, just in case (they should generally be unit vectors).", + " this.right.normalize();", + " this.up.normalize();", + " this.forward.normalize();", + " }", + "}", + "", + "/**", + " * It can be built the follow:", + " * ", + " * `objectDefaultRotation.setFromAxisAngle(new THREE.Vector3(0, 0, 1), -Math.PI/2);`", + " * ", + " * `objectDefaultRotation.multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI/2));`", + " * ", + " */", + "const objectDefaultRotation = new THREE.Quaternion(0.5, -0.5, -0.5, 0.5);", + "const targetQuaternion = new THREE.Quaternion();", + "const yAxis = new THREE.Vector3(0, 1, 0);", + "const zAxis = new THREE.Vector3(0, 0, 1);", + "const quaternion = new THREE.Quaternion();", + "const objectRotation = new THREE.Euler();", + "", + "/**", + " * @param object {gdjs.RuntimeObject}", + " * @param ratio {number}", + " * @param elevationAngleOffset {number}", + " */", + "function slerpCamera(object, ratio, rotationAngleOffset, elevationAngleOffset) {", + " const layer = object.getInstanceContainer().getLayer(object.getLayer());", + " const threeCamera = layer.getRenderer().getThreeCamera();", + " const threeObject = object.get3DRendererObject();", + "", + " objectRotation.copy(threeObject.rotation);", + " objectRotation.z = -objectRotation.z;", + " objectRotation.x = -objectRotation.x;", + " targetQuaternion.setFromEuler(objectRotation);", + " targetQuaternion.multiply(quaternion.setFromAxisAngle(zAxis, -gdjs.toRad(rotationAngleOffset)));", + " targetQuaternion.multiply(quaternion.setFromAxisAngle(yAxis, gdjs.toRad(elevationAngleOffset)));", + " targetQuaternion.multiply(objectDefaultRotation);", + "", + " threeCamera.quaternion.slerp(targetQuaternion, ratio);", + "", + " // The layer angle takes over the 3D camera Z rotation.", + " layer.setCameraRotation(gdjs.toDegrees(-threeCamera.rotation.z));", + "}", + "", + "gdjs.__thirdPersonCameraExtension = {", + " CameraLocalBasis,", + " ObjectLocalBasis,", + " slerpCamera,", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true } ], + "parameters": [], "objectGroups": [] }, { "description": "Move the camera to look at a position from a distance.", - "fullName": "Look at a position from a distance", + "fullName": "Look at a position from a distance (deprecated)", "functionType": "Action", - "name": "LookFromDistanceAtPosition3D", - "sentence": "Move the camera of _PARAM7_ to look at _PARAM1_; _PARAM2_; _PARAM3_ from _PARAM4_ pixels with a rotation of _PARAM5_° and an elevation of _PARAM6_°", + "name": "LookFromDistanceAtPosition", + "private": true, + "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_; _PARAM2_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34770,44 +34172,22 @@ "parameters": [ "", "=", - "PositionZ + Distance * sin(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationX" - }, - "parameters": [ - "", - "=", - "90 - ElevationAngle", + "Distance * sin(ToRad(ElevationAngle))", "Layer", "" ] }, { "type": { - "value": "Scene3D::SetCameraRotationY" + "value": "Scene3D::TurnCameraTowardPosition" }, "parameters": [ "", - "=", + "PositionX", + "PositionY", "0", "Layer", - "" - ] - }, - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ "", - "=", - "RotationAngle", - "Layer", "" ] } @@ -34825,11 +34205,190 @@ "name": "PositionY", "type": "expression" }, - { - "description": "Position on Z axis", - "name": "PositionZ", - "type": "expression" - }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look at an object from a distance.", + "fullName": "Look at an object from a distance (deprecated)", + "functionType": "Action", + "name": "LookFromDistanceAtObject", + "private": true, + "sentence": "Move the camera of _PARAM5_ to look at _PARAM1_ from _PARAM2_ pixels with a rotation of _PARAM3_° and an elevation of _PARAM4_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition" + }, + "parameters": [ + "", + "Object.CenterX()", + "Object.CenterY()", + "Distance", + "RotationAngle", + "ElevationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look at a position from a distance.", + "fullName": "Look at a position from a distance", + "functionType": "Action", + "name": "LookFromDistanceAtPosition3D", + "sentence": "Move the camera of _PARAM7_ to look at _PARAM1_; _PARAM2_; _PARAM3_ from _PARAM4_ pixels with a rotation of _PARAM5_° and an elevation of _PARAM6_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "=", + "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "PositionZ + Distance * sin(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "90 - ElevationAngle", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "0", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "RotationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Position on X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Position on Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Position on Z axis", + "name": "PositionZ", + "type": "expression" + }, { "description": "Distance", "name": "Distance", @@ -35092,6 +34651,36 @@ "name": "onCreated", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const { CameraLocalBasis, ObjectLocalBasis } = gdjs.__thirdPersonCameraExtension;\r", + "const object = objects[0];\r", + "const behavior = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Behavior\"));\r", + "behavior.__thirdPersonCameraExtension = {\r", + " cameraLocalBasis: new CameraLocalBasis(object),\r", + " objectlocalBasis: new ObjectLocalBasis(object)\r", + "};" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -35351,18 +34940,146 @@ "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * (1 - speed)\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * (1 - speed)\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * (1 - speed)^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln((1 - speed)))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Z translation", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "RotationMode", + "=", + "\"ZYX\"" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsRotatingWithObject", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::Slerp" + }, + "parameters": [ + "Object", + "Behavior", + "1 - exp(TimeDelta() * RotationLogSpeed)", + "RotationAngleOffset", + "ElevationAngleOffset", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::UpdateLocalBasis" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::MoveToObject" + }, + "parameters": [ + "Object", + "Behavior", + "OffsetX", + "OffsetY", + "OffsetZ", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "Distance * ForwardX", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "Distance * ForwardY", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "-", + "Distance * ForwardZ", + "Object.Layer()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "RotationMode", + "!=", + "\"ZYX\"" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsRotatingWithObject", + "True", + "" + ] + } + ] + } + ], + "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [], + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Z translation", + "source": "", + "type": "BuiltinCommonInstructions::Group", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -35418,131 +35135,306 @@ } ] } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Z rotation", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsRotatingWithObject", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedRotationAngle", - "=", - "Object.Angle()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsElevatingWithObject", - "True", - "" - ] - } ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedElevationAngle", - "=", - "Object.Object3D::RotationY()" - ] - } - ] + "parameters": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Z rotation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraRotationAngle", - "=", - "TargetedRotationAngle + 90 + RotationAngleOffset + AngleDifference(CameraAngle(Object.Layer()), TargetedRotationAngle + 90 + RotationAngleOffset) * exp(TimeDelta() * RotationLogSpeed)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsRotatingWithObject", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedRotationAngle", + "=", + "Object.Angle()" + ] + } ] }, { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraElevationAngle", - "=", - "TargetedElevationAngle + ElevationAngleOffset + AngleDifference(90 - Scene3D::CameraRotationX(Object.Layer()), TargetedElevationAngle + ElevationAngleOffset) * exp(TimeDelta() * ElevationLogSpeed)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "RotationMode", + "!=", + "\"Z\"" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsElevatingWithObject", + "True", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedElevationAngle", + "=", + "Object.Object3D::RotationY()" + ] + } ] }, { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" - }, - "parameters": [ - "", - "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraRotationAngle, OffsetX, -OffsetY)", - "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraRotationAngle, OffsetX, -OffsetY)", - "CameraZ + OffsetZ", - "Distance", - "CameraRotationAngle", - "CameraElevationAngle", - "", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraRotationAngle", + "=", + "TargetedRotationAngle + 90 + RotationAngleOffset + AngleDifference(CameraAngle(Object.Layer()), TargetedRotationAngle + 90 + RotationAngleOffset) * exp(TimeDelta() * RotationLogSpeed)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraElevationAngle", + "=", + "TargetedElevationAngle + ElevationAngleOffset + AngleDifference(90 - Scene3D::CameraRotationX(Object.Layer()), TargetedElevationAngle + ElevationAngleOffset) * exp(TimeDelta() * ElevationLogSpeed)" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraRotationAngle, OffsetX, -OffsetY)", + "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraRotationAngle, OffsetX, -OffsetY)", + "CameraZ + OffsetZ", + "Distance", + "CameraRotationAngle", + "CameraElevationAngle", + "Object.Layer()", + "" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "CameraRotationAngle", + "type": "number", + "value": 0 + }, + { + "name": "CameraElevationAngle", + "type": "number", + "value": 0 + } ] } ], - "variables": [ - { - "folded": true, - "name": "CameraRotationAngle", - "type": "number", - "value": 0 - }, - { - "name": "CameraElevationAngle", - "type": "number", - "value": 0 - } - ] + "parameters": [] } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Lerp camera", + "functionType": "Action", + "name": "Slerp", + "private": true, + "sentence": "Lerp the camera rotation to _PARAM0_ with a ratio of _PARAM2_ with rotation offset _PARAM3_° and elevation offset _PARAM4_°", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.RuntimeObject3D} */", + "const object = objects[0];", + "const ratio = eventsFunctionContext.getArgument(\"Ratio\");", + "const rotationAngleOffset = eventsFunctionContext.getArgument(\"NewRotationAngleOffset\");", + "const elevationAngleOffset = eventsFunctionContext.getArgument(\"NewElevationAngleOffset\");", + "", + "gdjs.__thirdPersonCameraExtension.slerpCamera(object, ratio, rotationAngleOffset, elevationAngleOffset);", + "" ], - "parameters": [] + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + }, + { + "description": "Ratio", + "name": "Ratio", + "type": "expression" + }, + { + "description": "Rotation angle offset", + "name": "NewRotationAngleOffset", + "type": "expression" + }, + { + "description": "Elevation angle offset", + "name": "NewElevationAngleOffset", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Move to object", + "functionType": "Action", + "name": "MoveToObject", + "private": true, + "sentence": "Change the camera position to _PARAM0_ with offset _PARAM2_, _PARAM3_, _PARAM4_ ", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.RuntimeObject3D} */", + "const object = objects[0];", + "const behavior = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Behavior\"));", + "const localOffsetX = eventsFunctionContext.getArgument(\"LocalOffsetX\");", + "const localOffsetY = eventsFunctionContext.getArgument(\"LocalOffsetY\");", + "const localOffsetZ = eventsFunctionContext.getArgument(\"LocalOffsetZ\");", + "", + "const layer = object.getInstanceContainer().getLayer(object.getLayer());", + "", + "const { objectlocalBasis } = behavior.__thirdPersonCameraExtension;", + "/** @type {{forward: THREE.Vector3, up: THREE.Vector3, right: THREE.Vector3 }} */", + "const { forward, up, right } = objectlocalBasis;", + "", + "layer.setCameraX(object.getCenterXInScene() + localOffsetX * right.x + localOffsetY * forward.x + localOffsetZ * up.x);", + "layer.setCameraY(object.getCenterYInScene() + localOffsetX * right.y + localOffsetY * forward.y + localOffsetZ * up.y);", + "layer.setCameraZ(object.getCenterZInScene() + localOffsetX * right.z + localOffsetY * forward.z + localOffsetZ * up.z);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + }, + { + "description": "X offset", + "name": "LocalOffsetX", + "type": "expression" + }, + { + "description": "Y offset", + "name": "LocalOffsetY", + "type": "expression" + }, + { + "description": "Z offset", + "name": "LocalOffsetZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update local basis", + "functionType": "Action", + "name": "UpdateLocalBasis", + "private": true, + "sentence": "Update local basis of _PARAM0_ and the camera", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behavior = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Behavior\"));", + "const { cameraLocalBasis, objectlocalBasis } = behavior.__thirdPersonCameraExtension;", + "cameraLocalBasis.update();", + "objectlocalBasis.update();", + "behavior._setForwardX(cameraLocalBasis.forward.x);", + "behavior._setForwardY(cameraLocalBasis.forward.y);", + "behavior._setForwardZ(cameraLocalBasis.forward.z);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true } ], "parameters": [ @@ -36900,7 +36792,7 @@ "value": "0.125", "type": "Number", "unit": "Second", - "label": "Halfway time for rotation", + "label": "Halfway time for rotation", "group": "Catch-up speed", "quickCustomizationVisibility": "hidden", "name": "RotationHalfwayDuration" @@ -36910,6 +36802,7 @@ "type": "Number", "unit": "Second", "label": "Halfway time for elevation rotation", + "description": "Only used by Z and ZY rotation modes", "group": "Catch-up speed", "quickCustomizationVisibility": "hidden", "name": "ElevationHalfwayDuration" @@ -36919,6 +36812,7 @@ "type": "Number", "unit": "Second", "label": "Halfway time on Z axis", + "description": "Only used by Z and ZY rotation modes", "group": "Catch-up speed", "quickCustomizationVisibility": "hidden", "name": "TranslationZHalfwayDuration" @@ -36961,6 +36855,7 @@ "unit": "DegreeAngle", "label": "Rotation angle offset", "group": "Position", + "advanced": true, "name": "RotationAngleOffset" }, { @@ -37045,15 +36940,36 @@ "value": "false", "type": "Boolean", "label": "Automatically rotate the camera with the object (elevation)", + "description": "Best left unchecked, use the rotation mode instead", + "deprecated": true, "quickCustomizationVisibility": "hidden", "name": "IsElevatingWithObject" }, + { + "value": "Z", + "type": "Choice", + "label": "Rotation mode", + "choices": [ + { + "label": "Horizontal rotation (good for characters)", + "value": "Z" + }, + { + "label": "Vertical and horizontal rotations (good for cars)", + "value": "ZY" + }, + { + "label": "All rotations (good for spaceships)", + "value": "ZYX" + } + ], + "name": "RotationMode" + }, { "value": "0", "type": "Number", "unit": "DegreeAngle", "label": "Targeted camera rotation angle", - "description": "When this angle is set, the camera follow this value instead of the object angle.", "hidden": true, "name": "TargetedRotationAngle" }, @@ -37062,9 +36978,32 @@ "type": "Number", "unit": "DegreeAngle", "label": "Targeted camera rotation angle", - "description": "When this angle is set, the camera follow this value instead of the object angle.", "hidden": true, "name": "TargetedElevationAngle" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Forward X", + "hidden": true, + "name": "ForwardX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Forward Y", + "hidden": true, + "name": "ForwardY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Forward Z", + "hidden": true, + "name": "ForwardZ" } ], "sharedPropertyDescriptors": [] @@ -52684,20 +52623,1570 @@ "Z", "" ] - }, + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Tile", + "Scale", + "=", + "(Width - 2 * Size) / Size" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsTiledOnX", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsTiledOnY", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Model9Patch3DSingleDepth::TileOnXY" + }, + "parameters": [ + "Object", + "Tile", + "Z", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Model9Patch3D::Model9Patch3DSingleDepth", + "type": "object" + }, + { + "description": "Tile", + "name": "Tile", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectListOrEmptyIfJustDeclared" + }, + { + "description": "Z position", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "100", + "type": "Number", + "unit": "Pixel", + "label": "Patch size", + "name": "Size" + }, + { + "value": "", + "type": "Boolean", + "label": "Tiled on X", + "name": "IsTiledOnX" + }, + { + "value": "", + "type": "Boolean", + "label": "Tiled on Y", + "name": "IsTiledOnY" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "TopCenter" + ], + "choices": [], + "hidden": true, + "name": "ShowTopCenter" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Side" + ], + "choices": [], + "hidden": true, + "name": "ShowSide" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Corner" + ], + "choices": [], + "hidden": true, + "name": "ShowCorner" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "BottomCenter" + ], + "choices": [], + "hidden": true, + "name": "ShowBottomCenter" + }, + { + "value": "-1", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "Width" + }, + { + "value": "-1", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "Height" + }, + { + "value": "-1", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "Depth" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "X" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "Y" + } + ], + "variants": [ + { + "areaMaxX": 200, + "areaMaxY": 200, + "areaMaxZ": 100, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Grass platform 100", + "objects": [ + { + "assetStoreId": "", + "name": "TopCenter", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 49.79781508445741, + "height": 100.00002384185794, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Corner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 99.79781210422519, + "height": 105.83601593971255, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Corner.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83598613739017, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Side", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 99.79781210422519, + "height": 100.00002384185794, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Side.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83593249320984, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "BottomCenter", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 50.000000000000014, + "height": 100.00002384185794, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Placeholder", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 200, + "height": 200, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Z", + "frontFaceResourceName": "assets\\Grass.png", + "backFaceResourceName": "assets\\Soil.png", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "assets\\Soil.png", + "rightFaceResourceName": "assets\\Soil.png", + "topFaceResourceName": "assets\\Soil.png", + "bottomFaceResourceName": "assets\\Soil.png", + "frontFaceVisible": true, + "backFaceVisible": true, + "leftFaceVisible": true, + "rightFaceVisible": true, + "topFaceVisible": true, + "bottomFaceVisible": true, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": true, + "leftFaceResourceRepeat": true, + "rightFaceResourceRepeat": true, + "topFaceResourceRepeat": true, + "bottomFaceResourceRepeat": true, + "materialType": "Basic" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "TopCenter" + }, + { + "objectName": "Side" + }, + { + "objectName": "Corner" + }, + { + "objectName": "BottomCenter" + }, + { + "objectName": "Placeholder" + } + ] + }, + "objectsGroups": [ + { + "name": "Patch", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "Corner" + }, + { + "name": "Side" + }, + { + "name": "BottomCenter" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Placeholder", + "persistentUuid": "472d203a-2423-42cd-8501-186230f28338", + "width": 100, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 2.7163745159088104, + "windowMask": false, + "selectedLayer": "" + } + } + ] + } + ] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "Respawn3D", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "", + "fullName": "", + "name": "Respawn3D", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "mod(TimeFromStart(), 3)", + "<", + "2 * TimeDelta()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Respawn3D::Respawn3D::SetPropertySafeX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.X()" + ] + }, + { + "type": { + "value": "Respawn3D::Respawn3D::SetPropertySafeY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y()" + ] + }, + { + "type": { + "value": "Respawn3D::Respawn3D::SetPropertySafeZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Object3D::Z()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn3D::Respawn3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Respawn", + "functionType": "Action", + "name": "Respawn", + "sentence": "Respawn _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "SafeX", + "=", + "SafeY" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "SafeZ" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn3D::Respawn3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" + }, + { + "value": "", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "SafeX" + }, + { + "value": "", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "SafeY" + }, + { + "value": "", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "SafeZ" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNjcmVlbi1yb3RhdGlvbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03LjUsMjEuNUM0LjI1LDE5Ljk0IDEuOTEsMTYuNzYgMS41NSwxM0gwLjA1QzAuNTYsMTkuMTYgNS43MSwyNCAxMiwyNEwxMi42NiwyMy45N0w4Ljg1LDIwLjE2TTE0LjgzLDIxLjE5TDIuODEsOS4xN0w5LjE3LDIuODFMMjEuMTksMTQuODNNMTAuMjMsMS43NUM5LjY0LDEuMTYgOC42OSwxLjE2IDguMTEsMS43NUwxLjc1LDguMTFDMS4xNiw4LjcgMS4xNiw5LjY1IDEuNzUsMTAuMjNMMTMuNzcsMjIuMjVDMTQuMzYsMjIuODQgMTUuMzEsMjIuODQgMTUuODksMjIuMjVMMjIuMjUsMTUuODlDMjIuODQsMTUuMyAyMi44NCwxNC4zNSAyMi4yNSwxMy43N0wxMC4yMywxLjc1TTE2LjUsMi41QzE5Ljc1LDQuMDcgMjIuMDksNy4yNCAyMi40NSwxMUgyMy45NUMyMy40NCw0Ljg0IDE4LjI5LDAgMTIsMEwxMS4zNCwwLjAzTDE1LjE1LDMuODRMMTYuNSwyLjVaIiAvPjwvc3ZnPg==", + "name": "ScreenOrientationChecker", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/0126888931a4a4f82bb2824df9f096347ace1c47f510c44df42aa8dc9e49e24a_screen-rotation.svg", + "shortDescription": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", + "version": "0.2.1", + "description": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", + "origin": { + "identifier": "ScreenOrientationChecker", + "name": "gdevelop-extension-store" + }, + "tags": [ + "screen", + "orientation" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2" + ], + "dependencies": [], + "globalVariables": [ + { + "name": "TargetOrientation", + "type": "string", + "value": "" + } + ], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "Get game target orientation", + "functionType": "StringExpression", + "name": "ProjectOrientation", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.orientation;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "ScreenOrientationChecker::ProjectOrientation()" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 400, + "areaMaxY": 200, + "areaMaxZ": 0, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "", + "description": "Automatically display a screen asking the player to rotate their screen if needed - on mobile phones and tablets only. Set up Anchor behavior on this object so that top/bottom/left/right edges are anchored to the screen top/bottom/left/right.", + "fullName": "Screen Orientation Checker", + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, + "name": "ScreenOrientationChecker", + "objects": [ + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Text", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "string": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "characterSize": 30, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 30, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "name": "BackgroundPainter", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [], + "fillOpacity": 255, + "outlineSize": 0, + "outlineOpacity": 255, + "absoluteCoordinates": true, + "clearBetweenFrames": true, + "antialiasing": "none", + "fillColor": { + "r": 0, + "g": 0, + "b": 0 + }, + "outlineColor": { + "r": 0, + "g": 0, + "b": 0 + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Icon", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "topEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Text" + }, + { + "objectName": "BackgroundPainter" + }, + { + "objectName": "Icon" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 35, + "keepRatio": true, + "layer": "", + "name": "Text", + "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", + "width": 207, + "x": 104, + "y": 120, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "BackgroundPainter", + "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", + "width": 0, + "x": 38, + "y": 17, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.9624060150375939, + "height": 96, + "layer": "", + "name": "Icon", + "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", + "width": 96, + "x": 158, + "y": 16, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.75, + "windowMask": false, + "selectedLayer": "" + }, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::ClearBetweenFrames" + }, + "parameters": [ + "BackgroundPainter", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Check if the screen must be shown" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneWindowWidth()", + ">", + "SceneWindowHeight()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneWindowWidth()", + "<=", + "SceneWindowHeight()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"landscape\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Show/hide the screen as needed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsShown", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsForceShown", + "True", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "IsShown", + "True", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "IsForceShown", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Icon", + "=", + "Text.Y() - 100" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Animate the icon" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Tween::Exists" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + }, + { + "type": { + "inverted": true, + "value": "Tween::Exists" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"", + "-8", + "\"easeInOutQuad\"", + "2", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Draw the background.", + "fullName": "Draw the background", + "functionType": "Action", + "name": "DrawBackground", + "private": true, + "sentence": "Draw the background of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "ScalableCapability::ScalableBehavior::SetX" + "value": "PrimitiveDrawing::RoundedRectangle" }, "parameters": [ - "Tile", - "Scale", - "=", - "(Width - 2 * Size) / Size" + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the screen should be forced to be shown. Use this to test the screen in your game.", + "fullName": "Force show the screen", + "functionType": "Condition", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -52706,17 +54195,7 @@ "value": "BooleanVariable" }, "parameters": [ - "IsTiledOnX", - "True", - "" - ] - }, - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsTiledOnY", + "IsForceShown", "True", "" ] @@ -52725,13 +54204,10 @@ "actions": [ { "type": { - "value": "Model9Patch3D::Model9Patch3DSingleDepth::TileOnXY" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Tile", - "Z", - "" + "True" ] } ] @@ -52741,475 +54217,70 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Model9Patch3D::Model9Patch3DSingleDepth", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" - }, - { - "description": "Tile", - "name": "Tile", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "objectListOrEmptyIfJustDeclared" - }, - { - "description": "Z position", - "name": "Z", - "type": "expression" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "100", - "type": "Number", - "unit": "Pixel", - "label": "Patch size", - "name": "Size" - }, - { - "value": "", - "type": "Boolean", - "label": "Tiled on X", - "name": "IsTiledOnX" - }, - { - "value": "", - "type": "Boolean", - "label": "Tiled on Y", - "name": "IsTiledOnY" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "TopCenter" - ], - "choices": [], - "hidden": true, - "name": "ShowTopCenter" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Side" - ], - "choices": [], - "hidden": true, - "name": "ShowSide" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Corner" - ], - "choices": [], - "hidden": true, - "name": "ShowCorner" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "BottomCenter" - ], - "choices": [], - "hidden": true, - "name": "ShowBottomCenter" - }, - { - "value": "-1", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "Width" - }, - { - "value": "-1", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "Height" - }, - { - "value": "-1", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "Depth" }, { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "X" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "Y" - } - ], - "variants": [ - { - "areaMaxX": 200, - "areaMaxY": 200, - "areaMaxZ": 100, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "name": "Grass platform 100", - "objects": [ - { - "assetStoreId": "", - "name": "TopCenter", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 49.79781508445741, - "height": 100.00002384185794, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Center Tall.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 90, - "width": 100.0000059604645, - "animations": [] - } - }, - { - "assetStoreId": "", - "name": "Corner", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 99.79781210422519, - "height": 105.83601593971255, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Corner.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 90, - "width": 105.83598613739017, - "animations": [] - } - }, - { - "assetStoreId": "", - "name": "Side", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 99.79781210422519, - "height": 100.00002384185794, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Side.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 90, - "width": 105.83593249320984, - "animations": [] - } - }, - { - "assetStoreId": "", - "name": "BottomCenter", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 50.000000000000014, - "height": 100.00002384185794, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Bottom Tall.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 90, - "width": 100.0000059604645, - "animations": [] - } - }, - { - "assetStoreId": "", - "name": "Placeholder", - "type": "Scene3D::Cube3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "width": 200, - "height": 200, - "depth": 100, - "enableTextureTransparency": false, - "facesOrientation": "Z", - "frontFaceResourceName": "assets\\Grass.png", - "backFaceResourceName": "assets\\Soil.png", - "backFaceUpThroughWhichAxisRotation": "X", - "leftFaceResourceName": "assets\\Soil.png", - "rightFaceResourceName": "assets\\Soil.png", - "topFaceResourceName": "assets\\Soil.png", - "bottomFaceResourceName": "assets\\Soil.png", - "frontFaceVisible": true, - "backFaceVisible": true, - "leftFaceVisible": true, - "rightFaceVisible": true, - "topFaceVisible": true, - "bottomFaceVisible": true, - "frontFaceResourceRepeat": false, - "backFaceResourceRepeat": true, - "leftFaceResourceRepeat": true, - "rightFaceResourceRepeat": true, - "topFaceResourceRepeat": true, - "bottomFaceResourceRepeat": true, - "materialType": "Basic" - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "TopCenter" - }, - { - "objectName": "Side" - }, - { - "objectName": "Corner" - }, - { - "objectName": "BottomCenter" - }, - { - "objectName": "Placeholder" - } - ] - }, - "objectsGroups": [ - { - "name": "Patch", - "objects": [ - { - "name": "TopCenter" - }, - { - "name": "Corner" - }, - { - "name": "Side" - }, - { - "name": "BottomCenter" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": false, - "height": 100, - "keepRatio": true, - "layer": "", - "name": "Placeholder", - "persistentUuid": "472d203a-2423-42cd-8501-186230f28338", - "width": 100, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridDepth": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridOffsetZ": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 2.7163745159088104, - "windowMask": false, - "selectedLayer": "" - } - } - ] - } - ] - }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "", - "name": "Respawn3D", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "", - "fullName": "", - "name": "Respawn3D", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", + "description": "Change if the screen should be forced to be shown. Use this to test the screen in your game.", + "fullName": "Force show the screen", "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "inverted": true, + "value": "BooleanVariable" }, "parameters": [ - "mod(TimeFromStart(), 3)", - "<", - "2 * TimeDelta()" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Respawn3D::Respawn3D::SetPropertySafeX" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "=", - "Object.X()" + "IsForceShown", + "False", + "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "Respawn3D::Respawn3D::SetPropertySafeY" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "=", - "Object.Y()" + "Value", + "True", + "" ] - }, + } + ], + "actions": [ { "type": { - "value": "Respawn3D::Respawn3D::SetPropertySafeZ" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "=", - "Object.Object3D::Z()" + "IsForceShown", + "False", + "" ] } ] @@ -53219,22 +54290,25 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Respawn3D::Respawn3D", - "type": "behavior" + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] }, { - "fullName": "Respawn", - "functionType": "Action", - "name": "Respawn", - "sentence": "Respawn _PARAM0_", + "description": "the message of the object.", + "fullName": "Message", + "functionType": "ExpressionAndCondition", + "name": "Message", + "sentence": "the message", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -53242,25 +54316,48 @@ "actions": [ { "type": { - "value": "MettreXY" + "value": "SetReturnString" }, "parameters": [ - "Object", - "=", - "SafeX", - "=", - "SafeY" + "Text.Text::Value()" ] - }, + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Message", + "name": "SetMessage", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "Scene3D::Base3DBehavior::SetZ" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ - "Object", - "Object3D", + "Text", + "Text", "=", - "SafeZ" + "Value" ] } ] @@ -53270,13 +54367,8 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Respawn3D::Respawn3D", - "type": "behavior" } ], "objectGroups": [] @@ -53285,509 +54377,353 @@ "propertyDescriptors": [ { "value": "", - "type": "Behavior", - "label": "3D capability", - "extraInformation": [ - "Scene3D::Base3DBehavior" - ], - "choices": [], - "name": "Object3D" - }, - { - "value": "", - "type": "Behavior", - "label": "3D physics character", - "extraInformation": [ - "Physics3D::PhysicsCharacter3D" - ], - "choices": [], - "name": "PhysicsCharacter3D" - }, - { - "value": "", - "type": "Number", - "unit": "Pixel", + "type": "Boolean", "label": "", "hidden": true, - "name": "SafeX" + "name": "IsShown" }, { "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "name": "IsForceShown" + }, + { + "value": "5", "type": "Number", "unit": "Pixel", - "label": "", - "hidden": true, - "name": "SafeY" + "label": "Padding", + "group": "Appearance", + "name": "Padding" }, { - "value": "", + "value": "10", "type": "Number", "unit": "Pixel", - "label": "", - "hidden": true, - "name": "SafeZ" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Input", - "extensionNamespace": "", - "fullName": "Screen Orientation Checker", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNjcmVlbi1yb3RhdGlvbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03LjUsMjEuNUM0LjI1LDE5Ljk0IDEuOTEsMTYuNzYgMS41NSwxM0gwLjA1QzAuNTYsMTkuMTYgNS43MSwyNCAxMiwyNEwxMi42NiwyMy45N0w4Ljg1LDIwLjE2TTE0LjgzLDIxLjE5TDIuODEsOS4xN0w5LjE3LDIuODFMMjEuMTksMTQuODNNMTAuMjMsMS43NUM5LjY0LDEuMTYgOC42OSwxLjE2IDguMTEsMS43NUwxLjc1LDguMTFDMS4xNiw4LjcgMS4xNiw5LjY1IDEuNzUsMTAuMjNMMTMuNzcsMjIuMjVDMTQuMzYsMjIuODQgMTUuMzEsMjIuODQgMTUuODksMjIuMjVMMjIuMjUsMTUuODlDMjIuODQsMTUuMyAyMi44NCwxNC4zNSAyMi4yNSwxMy43N0wxMC4yMywxLjc1TTE2LjUsMi41QzE5Ljc1LDQuMDcgMjIuMDksNy4yNCAyMi40NSwxMUgyMy45NUMyMy40NCw0Ljg0IDE4LjI5LDAgMTIsMEwxMS4zNCwwLjAzTDE1LjE1LDMuODRMMTYuNSwyLjVaIiAvPjwvc3ZnPg==", - "name": "ScreenOrientationChecker", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/0126888931a4a4f82bb2824df9f096347ace1c47f510c44df42aa8dc9e49e24a_screen-rotation.svg", - "shortDescription": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", - "version": "0.2.0", - "description": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", - "origin": { - "identifier": "ScreenOrientationChecker", - "name": "gdevelop-extension-store" - }, - "tags": [ - "screen", - "orientation" - ], - "authorIds": [ - "wWP8BSlAW0UP4NeaHa2LcmmDzmH2" - ], - "dependencies": [], - "globalVariables": [ - { - "name": "TargetOrientation", - "type": "string", - "value": "" - } - ], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "Get game target orientation", - "functionType": "StringExpression", - "name": "ProjectOrientation", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.orientation;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "name": "CornerRadius" } ], - "expressionType": { - "type": "string" - }, - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ + "variants": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "areaMaxX": 400, + "areaMaxY": 200, + "areaMaxZ": 0, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreAssetId": "2743bcd6cf431c6c00cda3a59684eb152b3a09d598b799b15383e4f77daf8b37", + "assetStoreOriginalName": "Black screen orientation checker", + "name": "Black screen orientation checker", + "objects": [ { - "type": { - "value": "SetStringVariable" + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Text", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "string": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "characterSize": 30, + "color": { + "b": 255, + "g": 255, + "r": 255 }, - "parameters": [ - "TargetOrientation", - "=", - "ScreenOrientationChecker::ProjectOrientation()" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [ - { - "areaMaxX": 400, - "areaMaxY": 200, - "areaMaxZ": 0, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "", - "description": "Automatically display a screen asking the player to rotate their screen if needed - on mobile phones and tablets only. Set up Anchor behavior on this object so that top/bottom/left/right edges are anchored to the screen top/bottom/left/right.", - "fullName": "Screen Orientation Checker", - "isInnerAreaFollowingParentSize": true, - "isUsingLegacyInstancesRenderer": false, - "name": "ScreenOrientationChecker", - "objects": [ - { - "assetStoreId": "", - "bold": true, - "italic": false, - "name": "Text", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "topEdgeAnchor": 4, - "useLegacyBottomAndRightAnchors": false + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 30, + "lineHeight": 0, + "color": "255;255;255" + } }, { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "string": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "characterSize": 30, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": true, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 30, - "lineHeight": 0, - "color": "255;255;255" - } - }, - { - "assetStoreId": "", - "name": "BackgroundPainter", - "type": "PrimitiveDrawing::Drawer", - "variables": [], - "effects": [], - "behaviors": [], - "fillOpacity": 255, - "outlineSize": 0, - "outlineOpacity": 255, - "absoluteCoordinates": true, - "clearBetweenFrames": true, - "antialiasing": "none", - "fillColor": { - "r": 0, - "g": 0, - "b": 0 - }, - "outlineColor": { - "r": 0, - "g": 0, - "b": 0 - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Icon", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "topEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false + "assetStoreId": "", + "name": "BackgroundPainter", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [], + "fillOpacity": 255, + "outlineSize": 0, + "outlineOpacity": 255, + "absoluteCoordinates": true, + "clearBetweenFrames": true, + "antialiasing": "none", + "fillColor": { + "r": 0, + "g": 0, + "b": 0 + }, + "outlineColor": { + "r": 0, + "g": 0, + "b": 0 + } }, { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "animations": [ - { - "name": "", - "useMultipleDirections": false, - "directions": [ + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Icon", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "rotate-screen-icon.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 52.5, - "y": 56.5 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 1 - }, - { - "x": 105, - "y": 1 - }, - { - "x": 105, - "y": 113 + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "topEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "rotate-screen-icon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 52.5, + "y": 56.5 }, - { + "centerPoint": { + "automatic": true, + "name": "centre", "x": 0, - "y": 113 - } - ] + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 1 + }, + { + "x": 105, + "y": 1 + }, + { + "x": 105, + "y": 113 + }, + { + "x": 0, + "y": 113 + } + ] + ] + } ] } ] } ] } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Text" - }, - { - "objectName": "BackgroundPainter" - }, - { - "objectName": "Icon" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 35, - "keepRatio": true, - "layer": "", - "name": "Text", - "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", - "width": 207, - "x": 104, - "y": 120, - "zOrder": 15, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "BackgroundPainter", - "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", - "width": 0, - "x": 38, - "y": 17, - "zOrder": 14, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "Icon", - "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", - "width": 0, - "x": 204, - "y": 64, - "zOrder": 16, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {}, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Text" + }, + { + "objectName": "BackgroundPainter" + }, + { + "objectName": "Icon" + } + ] + }, + "objectsGroups": [], + "layers": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ { - "type": { - "value": "PrimitiveDrawing::ClearBetweenFrames" - }, - "parameters": [ - "BackgroundPainter", - "" - ] + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 } - ] + ], + "effects": [] } ], - "parameters": [ + "instances": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" + "angle": 0, + "customSize": true, + "depth": 1, + "height": 35, + "keepRatio": true, + "layer": "", + "name": "Text", + "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", + "width": 207, + "x": 104, + "y": 120, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "BackgroundPainter", + "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", + "width": 0, + "x": 38, + "y": 17, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Icon", + "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", + "width": 0, + "x": 204, + "y": 64, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], - "objectGroups": [] - }, + "editionSettings": {} + } + ] + } + ] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "3D Platformer thrid person camera", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXJ1biIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMy41LDUuNUMxNC41OSw1LjUgMTUuNSw0LjU4IDE1LjUsMy41QzE1LjUsMi4zOCAxNC41OSwxLjUgMTMuNSwxLjVDMTIuMzksMS41IDExLjUsMi4zOCAxMS41LDMuNUMxMS41LDQuNTggMTIuMzksNS41IDEzLjUsNS41TTkuODksMTkuMzhMMTAuODksMTVMMTMsMTdWMjNIMTVWMTUuNUwxMi44OSwxMy41TDEzLjUsMTAuNUMxNC43OSwxMiAxNi43OSwxMyAxOSwxM1YxMUMxNy4wOSwxMSAxNS41LDEwIDE0LjY5LDguNThMMTMuNjksN0MxMy4yOSw2LjM4IDEyLjY5LDYgMTIsNkMxMS42OSw2IDExLjUsNi4wOCAxMS4xOSw2LjA4TDYsOC4yOFYxM0g4VjkuNThMOS43OSw4Ljg4TDguMTksMTdMMy4yOSwxNkwyLjg5LDE4TDkuODksMTkuMzhaIiAvPjwvc3ZnPg==", + "name": "PlatformerCamera3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/9c46751a1bc104989c2d9c728f36220473e26ed7db2b0590a92841bbdfbd86c7_run.svg", + "shortDescription": "Allow players to rotate the camera and move the character in the camera direction.", + "version": "1.0.0", + "description": "Allow players to rotate the camera and move the character in the camera direction.", + "tags": [ + "3d" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Allow players to rotate the camera and move the character in the camera direction.", + "fullName": "3D Platformer thrid person camera", + "name": "PlatformerCamera3D", + "objectType": "", + "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "doStepPostEvents", + "name": "doStepPreEvents", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenOrientationChecker::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" - }, - "parameters": [ - "Object", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ScreenOrientationChecker::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [], + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Camera controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -53799,226 +54735,335 @@ "textG": 0, "textR": 0 }, - "comment": "Check if the screen must be shown" + "comment": "Camera object rotates along with the player's cursor, and the in game camera rotates based on the position of the Camera object" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SystemInfo::IsMobile" + "value": "SpriteMultitouchJoystick::StickForce" }, - "parameters": [] + "parameters": [ + "", + ">", + "0", + "1", + "\"Primary\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ControlKind", + "=", + "\"Touch\"" + ] } ], - "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "BooleanVariable" }, "parameters": [ - "SceneWindowWidth()", - ">", - "SceneWindowHeight()" + "IsCameraLocked", + "False", + "" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "\"portrait\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsShown", - "False", - "" - ] - } + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "=", + "MovingRotationHalfwayDuration", + "" ] - }, + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "1", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ControlKind", + "=", + "\"Gamepad\"" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "=", + "MovingRotationHalfwayDuration", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "!=", - "\"portrait\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsShown", - "False", - "" - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsCameraLocked", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "=", + "MovingRotationHalfwayDuration", + "" ] } ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AnyKeyPressed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ControlKind", + "=", + "\"Keyboard\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "ControlKind", + "!=", + "\"Keyboard\"" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": { + "value": "BuiltinCommonInstructions::Not" + }, + "parameters": [], + "subInstructions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "SceneWindowWidth()", - "<=", - "SceneWindowHeight()" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "\"landscape\"" - ] - } - ], - "actions": [ + "parameters": [], + "subInstructions": [ { "type": { - "value": "SetBooleanVariable" + "value": "Gamepads::StickForce" }, "parameters": [ - "IsShown", - "False", + "", + ">", + "0", + "1", + "\"Left\"", "" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "\"portrait\"" - ] - } - ], - "actions": [ + }, { "type": { - "value": "SetBooleanVariable" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "IsShown", - "False", + "", + ">", + "0", + "1", + "\"Primary\"", "" ] } ] } ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "=", + "IdlingRotationHalfwayDuration", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCameraLocked", + "False", + "" + ] } ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Show/hide the screen as needed" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "ControlKind", + "=", + "\"Keyboard\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCameraLocked", + "True", + "" + ] + } + ] }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "MousePointerLock::isPointerLocked" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsShown", - "True", - "" - ] - }, - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsForceShown", - "True", - "" - ] - } + "parameters": [ + "", + "" + ] + }, + { + "type": { + "value": "MousePointerLock::IsMoving" + }, + "parameters": [ + "", + "" ] } ], "actions": [ { "type": { - "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetCameraRotation" }, "parameters": [ "Object", + "ThirdPersonCamera", + "+", + "MouseRotationSensitivityX * MousePointerLock::MovementX() / SceneWindowWidth()", "" ] }, { "type": { - "value": "Montre" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationAngleOffset" }, "parameters": [ "Object", + "ThirdPersonCamera", + "+", + "MouseRotationSensitivityY * MousePointerLock::MovementY() / SceneWindowHeight()", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCameraLocked", + "True", "" ] } @@ -54029,23 +55074,24 @@ "conditions": [ { "type": { - "inverted": true, - "value": "BooleanVariable" + "value": "Gamepads::C_Controller_X_is_connected" }, "parameters": [ - "IsShown", - "True", + "", + "1", "" ] }, { "type": { - "inverted": true, - "value": "BooleanVariable" + "value": "Gamepads::StickForce" }, "parameters": [ - "IsForceShown", - "True", + "", + ">", + "0", + "1", + "\"Right\"", "" ] } @@ -54053,26 +55099,65 @@ "actions": [ { "type": { - "value": "Cache" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetCameraRotation" }, "parameters": [ - "Object" + "Object", + "ThirdPersonCamera", + "+", + "GamepadRotationSensitivityX * Gamepads::StickForceX(1, \"Right\") * TimeDelta()", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationAngleOffset" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "+", + "GamepadRotationSensitivityY * Gamepads::StickForceY(1, \"Right\") * TimeDelta()", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCameraLocked", + "True", + "" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsCameraLocked", + "True", + "" + ] + } + ], "actions": [ { "type": { - "value": "MettreY" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" }, "parameters": [ - "Icon", + "Object", + "ThirdPersonCamera", "=", - "Text.Y() - 100" + "1000000", + "" ] } ] @@ -54087,46 +55172,73 @@ "textG": 0, "textR": 0 }, - "comment": "Animate the icon" + "comment": "Make sure the camera doesn't get upsidedown." }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": true, - "value": "Tween::Exists" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ - "Icon", - "Tween", - "\"Rotate\"" + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), -90, 90)" ] }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationAngleOffset" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "=", + "clamp(Object.ThirdPersonCamera::ElevationAngleOffset(), -90, 90)", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Let the character jumps or fells a bit before the camera follow them." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { "inverted": true, - "value": "Tween::Exists" + "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" }, "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"" + "Object", + "PhysicsCharacter3D" ] } ], "actions": [ { "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetFollowFreeAreaZMin" }, "parameters": [ - "Icon", - "Tween", - "\"Rotate\"", - "8", - "\"easeInOutQuad\"", - "2", + "Object", + "ThirdPersonCamera", + "=", + "AirFollowFreeAreaBottom", "" ] } @@ -54137,38 +55249,55 @@ "conditions": [ { "type": { - "value": "Tween::HasFinished" + "value": "Physics3D::PhysicsCharacter3D::IsOnFloor" }, "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"" + "Object", + "PhysicsCharacter3D" ] } ], "actions": [ { "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetFollowFreeAreaZMin" }, "parameters": [ - "Icon", - "Tween", - "\"Rotate\"", - "8", - "\"easeInOutQuad\"", - "2", + "Object", + "ThirdPersonCamera", + "=", + "0", "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Avoid to rotate the camera more than 90° when the character goes backward." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "Tween::RemoveTween" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetTargetedRotationAngle" }, "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"" + "Object", + "ThirdPersonCamera", + "=", + "Object.PhysicsCharacter3D::ForwardAngle()", + "" ] } ] @@ -54178,592 +55307,331 @@ "conditions": [ { "type": { - "value": "Tween::HasFinished" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Icon", - "Tween", - "\"Rotate\"" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PlatformerCamera3D::PlatformerCamera3D::WasBackwardKeyPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PlatformerCamera3D::PlatformerCamera3D::WasStickUsed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(AngleDifference(90, SpriteMultitouchJoystick::StickAngle(1, \"Primary\")))", + "<", + "90" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(AngleDifference(90, Gamepads::StickAngle(1, \"Left\")))", + "<", + "90" + ] + } + ] + } + ] + } ] } ], "actions": [ { "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" - }, - "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"", - "-8", - "\"easeInOutQuad\"", - "2", - "" - ] - }, - { - "type": { - "value": "Tween::RemoveTween" + "value": "ThirdPersonCamera::ThirdPersonCamera::SetTargetedRotationAngle" }, "parameters": [ - "Icon", - "Tween", - "\"Rotate\"" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Draw the background.", - "fullName": "Draw the background", - "functionType": "Action", - "name": "DrawBackground", - "private": true, - "sentence": "Draw the background of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::RoundedRectangle" - }, - "parameters": [ - "BackgroundPainter", - "Padding", - "Padding", - "Object.Width()-Padding", - "Object.Height()-Padding", - "CornerRadius" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the screen should be forced to be shown. Use this to test the screen in your game.", - "fullName": "Force show the screen", - "functionType": "Condition", - "name": "IsForceShown", - "sentence": "_PARAM0_ is forced to be shown", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsForceShown", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Change if the screen should be forced to be shown. Use this to test the screen in your game.", - "fullName": "Force show the screen", - "functionType": "Action", - "name": "SetIsForceShown", - "sentence": "Force _PARAM0_ to be shown: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" + "Object", + "ThirdPersonCamera", + "=", + "180 - Object.PhysicsCharacter3D::ForwardAngle()", + "" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetBooleanVariable" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "IsForceShown", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "comment": "Avoid to rotate the camera when the character goes backward." + }, { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(AngleDifference(Object.ThirdPersonCamera::TargetedRotationAngle() + 90, CameraAngle()))", + ">", + "90" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "ThirdPersonCamera", + "=", + "1000000", + "" + ] + } ] } ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsForceShown", - "False", - "" - ] - } - ] + "parameters": [] } ], "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" }, { - "defaultValue": "yes", - "description": "Force show the screen?", - "name": "Value", - "optional": true, - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PlatformerCamera3D::PlatformerCamera3D", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the message of the object.", - "fullName": "Message", - "functionType": "ExpressionAndCondition", - "name": "Message", - "sentence": "the message", + "description": "Check if the backward key is pressed for the 3D character.", + "fullName": "Backward key is pressed", + "functionType": "Condition", + "name": "WasBackwardKeyPressed", + "private": true, + "sentence": "Backward key of _PARAM0_ is pressed", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Text.Text::Value()" - ] - } - ] + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behavior = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Behavior\"));", + "/** @type {gdjs.PhysicsCharacter3DRuntimeBehavior} */", + "const characterBehavior = object.getBehavior(behavior._getPhysicsCharacter3D());", + "", + "eventsFunctionContext.returnValue = characterBehavior.wasBackwardKeyPressed();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false } ], - "expressionType": { - "type": "string" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PlatformerCamera3D::PlatformerCamera3D", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Message", - "name": "SetMessage", - "sentence": "", + "description": "Check if the Stick is used for the 3D character.", + "fullName": "Stick is used", + "functionType": "Condition", + "name": "WasStickUsed", + "private": true, + "sentence": "The stick of _PARAM0_ is used", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Text", - "Text", - "=", - "Value" - ] - } - ] + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behavior = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Behavior\"));", + "/** @type {gdjs.PhysicsCharacter3DRuntimeBehavior} */", + "const characterBehavior = object.getBehavior(behavior._getPhysicsCharacter3D());", + "", + "eventsFunctionContext.returnValue = characterBehavior.wasStickUsed();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false } ], "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PlatformerCamera3D::PlatformerCamera3D", + "type": "behavior" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" + }, + { + "value": "", + "type": "Behavior", + "label": "Third person camera", + "extraInformation": [ + "ThirdPersonCamera::ThirdPersonCamera" + ], + "choices": [], + "name": "ThirdPersonCamera" + }, { "value": "", "type": "Boolean", "label": "", "hidden": true, - "name": "IsShown" + "name": "IsCameraLocked" }, { - "value": "", - "type": "Boolean", - "label": "Force show the screen", - "description": "Use this to test the screen in your game", - "name": "IsForceShown" + "value": "Keyboard", + "type": "String", + "label": "", + "hidden": true, + "name": "ControlKind" }, { - "value": "5", + "value": "0.5", "type": "Number", - "unit": "Pixel", - "label": "Padding", - "group": "Appearance", - "name": "Padding" + "unit": "Second", + "label": "Halfway time for rotation when idling", + "group": "Camera following", + "name": "IdlingRotationHalfwayDuration" }, { - "value": "10", + "value": "2", + "type": "Number", + "unit": "Second", + "label": "Halfway time for rotation when idling", + "group": "Camera following", + "name": "MovingRotationHalfwayDuration" + }, + { + "value": "0", "type": "Number", "unit": "Pixel", - "label": "Corner radius", - "description": "Corner radius for the background", - "group": "Appearance", - "name": "CornerRadius" - } - ], - "variants": [ + "label": "Follow free area bottom in the air", + "group": "Camera following", + "name": "AirFollowFreeAreaBottom" + }, { - "areaMaxX": 400, - "areaMaxY": 200, - "areaMaxZ": 0, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "assetStoreAssetId": "2743bcd6cf431c6c00cda3a59684eb152b3a09d598b799b15383e4f77daf8b37", - "assetStoreOriginalName": "Black screen orientation checker", - "name": "Black screen orientation checker", - "objects": [ - { - "assetStoreId": "", - "bold": true, - "italic": false, - "name": "Text", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "topEdgeAnchor": 4, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "string": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "characterSize": 30, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": true, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 30, - "lineHeight": 0, - "color": "255;255;255" - } - }, - { - "assetStoreId": "", - "name": "BackgroundPainter", - "type": "PrimitiveDrawing::Drawer", - "variables": [], - "effects": [], - "behaviors": [], - "fillOpacity": 255, - "outlineSize": 0, - "outlineOpacity": 255, - "absoluteCoordinates": true, - "clearBetweenFrames": true, - "antialiasing": "none", - "fillColor": { - "r": 0, - "g": 0, - "b": 0 - }, - "outlineColor": { - "r": 0, - "g": 0, - "b": 0 - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Icon", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "topEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "animations": [ - { - "name": "", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "rotate-screen-icon.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 52.5, - "y": 56.5 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 1 - }, - { - "x": 105, - "y": 1 - }, - { - "x": 105, - "y": 113 - }, - { - "x": 0, - "y": 113 - } - ] - ] - } - ] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Text" - }, - { - "objectName": "BackgroundPainter" - }, - { - "objectName": "Icon" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 35, - "keepRatio": true, - "layer": "", - "name": "Text", - "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", - "width": 207, - "x": 104, - "y": 120, - "zOrder": 15, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "BackgroundPainter", - "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", - "width": 0, - "x": 38, - "y": 17, - "zOrder": 14, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "Icon", - "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", - "width": 0, - "x": 204, - "y": 64, - "zOrder": 16, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {} + "value": "180", + "type": "Number", + "unit": "DegreeAngle", + "label": "Mouse horizontal rotation sensivity", + "description": "How much degrees to rotate when the mouse covers 1 screen width", + "group": "Camera rotation", + "name": "MouseRotationSensitivityX" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Mouse vertical rotation sensivity", + "description": "How much degrees to rotate when the mouse covers 1 screen height", + "group": "Camera rotation", + "name": "MouseRotationSensitivityY" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Gamepad horizontal rotation sensivity", + "group": "Camera rotation", + "name": "GamepadRotationSensitivityX" + }, + { + "value": "90", + "type": "Number", + "unit": "AngularSpeed", + "label": "Gamepad vertical rotation sensivity", + "group": "Camera rotation", + "name": "GamepadRotationSensitivityY" } - ] + ], + "sharedPropertyDescriptors": [] } - ] + ], + "eventsBasedObjects": [] } ], "externalLayouts": [ @@ -54824,13 +55692,16 @@ "gridType": "rectangular", "gridWidth": 32, "gridHeight": 32, + "gridDepth": 32, "gridOffsetX": 0, "gridOffsetY": 0, + "gridOffsetZ": 0, "gridColor": 10401023, "gridAlpha": 0.8, "snap": false, "zoomFactor": 0.546875, - "windowMask": false + "windowMask": false, + "selectedLayer": "" } } ]