diff --git a/Scenes/Blizzard.tscn b/Scenes/Blizzard.tscn index dd221ce..a812b22 100644 --- a/Scenes/Blizzard.tscn +++ b/Scenes/Blizzard.tscn @@ -11,6 +11,7 @@ rings = 1 [node name="Blizzard" type="Node3D"] script = ExtResource("1_rqtsv") +_projectileSpeed = 10.0 [node name="MeshInstance3D" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11373, 0) diff --git a/Scenes/Main.tscn b/Scenes/Main.tscn index f1ba317..387411c 100644 --- a/Scenes/Main.tscn +++ b/Scenes/Main.tscn @@ -20,7 +20,7 @@ height = 1.0 [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_xwe0t"] radius = 21.859 -height = 86.061 +height = 77.0175 [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8y7we"] albedo_color = Color(0.937255, 0, 0.298039, 1) @@ -61,7 +61,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, transform = Transform3D(-0.01, 0, -8.74228e-10, 0, 0.01, 0, 8.74228e-10, 0, -0.01, 0, 0.20569, 0) [node name="CollisionShape3D" type="CollisionShape3D" parent="Player"] -transform = Transform3D(1, 0, 7.10543e-15, 0, 1, 0, -7.10543e-15, 0, 1, 0, 0.690513, 0) +transform = Transform3D(1, 0, 7.10543e-15, 0, 1, 0, -7.10543e-15, 0, 1, 0, 0.680709, 0) shape = SubResource("CapsuleShape3D_v20i5") [node name="CameraMount" type="SpringArm3D" parent="Player"] @@ -72,7 +72,7 @@ script = ExtResource("3_5ecw2") _sensitivityHorizontal = 0.03 _sensitivityVertical = 0.03 -[node name="Camera3D" type="Camera3D" parent="Player/CameraMount"] +[node name="Camera" type="Camera3D" parent="Player/CameraMount"] current = true far = 54.29 @@ -87,7 +87,7 @@ script = ExtResource("4_o5mpp") transform = Transform3D(1, 0, -7.10543e-15, 0, 1, 0, 7.10543e-15, 0, 1, 0, 0, 0) [node name="CollisionShape3D" type="CollisionShape3D" parent="NPC1"] -transform = Transform3D(1, 0, -7.10543e-15, 0, 1, 0, 7.10543e-15, 0, 1, 0, 41.4825, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 35.6294, 0) shape = SubResource("CapsuleShape3D_xwe0t") [node name="Boxes" type="Node" parent="."] diff --git a/Scenes/fireball.tscn b/Scenes/fireball.tscn index 93eb07c..9da2786 100644 --- a/Scenes/fireball.tscn +++ b/Scenes/fireball.tscn @@ -10,6 +10,7 @@ albedo_color = Color(0.666667, 0, 0.239216, 1) [node name="Fireball" type="Node3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.916843, 0) script = ExtResource("1_4ipg4") +_projectileSpeed = 20.0 [node name="MeshInstance3D" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00392, 0) diff --git a/Scripts/Blizzard.cs b/Scripts/Blizzard.cs index f09d9b1..cc8923e 100644 --- a/Scripts/Blizzard.cs +++ b/Scripts/Blizzard.cs @@ -1,9 +1,7 @@ -using Godot; - public partial class Blizzard : Projectile { public override void _PhysicsProcess(double delta) { - Translate(new Vector3(0, 0, -Speed)); + Translate(new Godot.Vector3(0, 0, Speed * (float)delta)); } } diff --git a/Scripts/Fireball.cs b/Scripts/Fireball.cs index ca5c562..26036ef 100644 --- a/Scripts/Fireball.cs +++ b/Scripts/Fireball.cs @@ -1,9 +1,7 @@ -using Godot; - public partial class Fireball : Projectile { public override void _PhysicsProcess(double delta) { - Translate(new Vector3(0, 0, -Speed)); + Translate(new Godot.Vector3(0, 0, Speed * (float)delta)); } } diff --git a/Scripts/Player.cs b/Scripts/Player.cs index 7644d7d..33d3011 100644 --- a/Scripts/Player.cs +++ b/Scripts/Player.cs @@ -19,6 +19,7 @@ public partial class Player : CharacterBody3D private Node3D _cameraMount; private Node3D _pivot; + private Node3D _camera; private PackedScene _weaponType; // Get the _gravity from the project settings to be synced with RigidBody nodes. @@ -28,6 +29,7 @@ public partial class Player : CharacterBody3D { Input.MouseMode = Input.MouseModeEnum.Captured; _cameraMount = GetNode("/root/Main/Player/CameraMount"); + _camera = GetNode("/root/Main/Player/CameraMount/Camera"); _pivot = GetNode("/root/Main/Player/Pivot"); _weaponType = _projectiles.First(); } @@ -56,6 +58,7 @@ public partial class Player : CharacterBody3D GD.Print("Shoot"); var projectile = _weaponType.Instantiate(); projectile.Position = Position; + projectile.Rotation = Rotation; GetParent().AddChild(projectile); }