Felix builds level

First Controller setup
ai
Sascha 2024-02-18 16:59:00 +07:00
parent d48368a889
commit db839f533c
10 changed files with 389 additions and 346 deletions

@ -4,4 +4,3 @@
background_mode = 1
fog_enabled = true
fog_light_color = Color(0.317647, 0.345098, 0.392157, 1)
volumetric_fog_enabled = true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -70333,7 +70333,7 @@ bones/42/rotation = Quaternion(-0.551742, 0.442245, 0.551742, -0.442245)
bones/42/scale = Vector3(1, 1, 1)
[node name="Skeleton_Rogue_Hood" type="BoneAttachment3D" parent="Skeleton_Rogue/Rig/Skeleton3D"]
transform = Transform3D(1, 7.45057e-09, 1.9817e-11, 1.41946e-14, 1, -4.53622e-10, -1.98188e-11, 4.53622e-10, 1, 0.0326843, 1.16909, -1.37917e-07)
transform = Transform3D(1, -1.42195e-14, 1.98295e-11, 1.41946e-14, 1, -4.53623e-10, -1.98312e-11, 4.53623e-10, 1, 0.0326843, 1.16909, -1.37917e-07)
bone_name = "Skeleton_Rogue_Hood"
bone_idx = 15
@ -70342,7 +70342,7 @@ mesh = SubResource("ArrayMesh_vexp4")
skeleton = NodePath("")
[node name="Skeleton_Rogue_Cape" type="BoneAttachment3D" parent="Skeleton_Rogue/Rig/Skeleton3D"]
transform = Transform3D(1, 7.45058e-09, 1.98028e-11, -1.62844e-17, 1, -4.53628e-10, -1.98046e-11, 4.53629e-10, 1, 0.0326805, 1.16909, -1.34192e-07)
transform = Transform3D(1, -8.63687e-18, 1.98153e-11, -1.62844e-17, 1, -4.53629e-10, -1.9817e-11, 4.53629e-10, 1, 0.0326805, 1.16909, -1.34191e-07)
bone_name = "Skeleton_Rogue_Cape"
bone_idx = 16

@ -70311,7 +70311,7 @@ bones/41/rotation = Quaternion(-0.551742, 0.442245, 0.551742, -0.442245)
bones/41/scale = Vector3(1, 1, 1)
[node name="Skeleton_Warrior_Helmet" type="BoneAttachment3D" parent="Skeleton_Warrior/Rig/Skeleton3D"]
transform = Transform3D(1, 7.45058e-09, 1.98028e-11, -1.62829e-17, 1, -4.53628e-10, -1.98046e-11, 4.53629e-10, 1, 0.0326824, 1.16909, -1.36054e-07)
transform = Transform3D(1, -8.63835e-18, 1.98153e-11, -1.62829e-17, 1, -4.53629e-10, -1.9817e-11, 4.53629e-10, 1, 0.0326824, 1.16909, -1.36054e-07)
bone_name = "Skeleton_Warrior_Helmet"
bone_idx = 15

@ -20,6 +20,17 @@ private const float maxXRot = .25f;
// public override void _Process(double delta) => GlobalPosition = GetParent<Node3D>().GlobalPosition;
public override void _Input(InputEvent @event) {
if (springArm3D != null) {
springArm3D.SpringLength += @event.GetActionStrength("ZoomOut") - @event.GetActionStrength("ZoomIn");
float viewLeftRight = @event.GetActionStrength("ViewLeft") - @event.GetActionStrength("ViewRight");
float viewUpDown = @event.GetActionStrength("ViewUp") - @event.GetActionStrength("ViewDown");
float xRot = Mathf.Clamp(Rotation.X - viewLeftRight / 1000 * sensitivity, -maxXRot, +maxXRot * 2);
float yRot = Rotation.Y - viewUpDown / 1000 * sensitivity;
GD.Print($"{viewLeftRight}:{viewUpDown} -> {xRot}:{yRot}");
// Rotation = new(xRot, yRot, 0);
}
switch (@event) {
case InputEventMouseMotion inputEventMouseMotion: {
float xRot = Mathf.Clamp(Rotation.X - inputEventMouseMotion.Relative.Y / 1000 * sensitivity, -maxXRot, +maxXRot * 2);
@ -28,14 +39,11 @@ private const float maxXRot = .25f;
break;
}
case InputEventMouseButton inputEventMouseButton: {
if (inputEventMouseButton.ButtonIndex == MouseButton.WheelDown) {
if (springArm3D?.SpringLength < minZoom)
springArm3D.SpringLength += 0.1f;
}
else if (inputEventMouseButton.ButtonIndex == MouseButton.WheelUp) {
if (springArm3D?.SpringLength > maxZoom)
springArm3D.SpringLength -= 0.1f;
}
if (inputEventMouseButton.ButtonIndex == MouseButton.WheelDown)
if (springArm3D?.SpringLength < minZoom) springArm3D.SpringLength += 0.1f;
else if (inputEventMouseButton.ButtonIndex == MouseButton.WheelUp)
if (springArm3D?.SpringLength > maxZoom)
springArm3D.SpringLength -= 0.1f;
break;
}
case InputEventKey inputEventKey: {

@ -43,7 +43,7 @@ public partial class Player : CharacterBody3D
if (cameraController != null) {
float horizontalRotationAngle = cameraController.Transform.Basis.GetEuler().Y;
Direction = Direction.Rotated(Vector3.Up, horizontalRotationAngle);
if (PlayerMesh != null) PlayerMesh.Rotation = PlayerMesh.Rotation.Slerp(cameraController.Rotation, 0.05f);
if (PlayerMesh != null) PlayerMesh.Rotation = PlayerMesh.Rotation.Slerp(cameraController.Rotation, 0.05f).Normalized();
}
Velocity = velocity;
MoveAndSlide();

File diff suppressed because one or more lines are too long

@ -41,35 +41,71 @@ WalkLeft={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
]
}
WalkRight={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
]
}
WalkUp={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
]
}
WalkDown={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
]
}
Jump={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
]
}
Attack={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(85, 11),"global_position":Vector2(89, 52),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
]
}
ViewLeft={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null)
]
}
ViewRight={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null)
]
}
ViewUp={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null)
]
}
ViewDown={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
]
}
ZoomIn={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null)
]
}
ZoomOut={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null)
]
}