Aim good
This commit is contained in:
@@ -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