Aim good
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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="."]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Node3D>("/root/Main/Player/CameraMount");
|
||||
_camera = GetNode<Node3D>("/root/Main/Player/CameraMount/Camera");
|
||||
_pivot = GetNode<Node3D>("/root/Main/Player/Pivot");
|
||||
_weaponType = _projectiles.First();
|
||||
}
|
||||
@@ -56,6 +58,7 @@ public partial class Player : CharacterBody3D
|
||||
GD.Print("Shoot");
|
||||
var projectile = _weaponType.Instantiate<Node3D>();
|
||||
projectile.Position = Position;
|
||||
projectile.Rotation = Rotation;
|
||||
GetParent().AddChild(projectile);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user