This commit is contained in:
2023-09-11 17:42:11 -07:00
parent ba9c1e320e
commit 4d8fbda71b
21 changed files with 123 additions and 67 deletions

View File

@@ -19,6 +19,7 @@ public partial class Character : CharacterBody3D
public override void _EnterTree()
{
Position = OwnerPlayer.SpawnPoint.Position;
CanShoot = true;
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
@@ -100,8 +101,6 @@ public partial class Character : CharacterBody3D
public void OnHit(Node3D node)
{
GD.Print($"Hit by {node.Name}");
if (this != null)
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
}
}

View File

@@ -2,7 +2,7 @@ using Godot;
public partial class SpawnPoint : Marker3D
{
public void SetPlayerPosition(Node3D character)
public void SetPlayerPosition(Character character)
{
GD.Print("Moving character to spawn point");
character.Position = Position;

View File

@@ -44,6 +44,7 @@ tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Forward Shot/PathFollow3D"]
collision_layer = 44
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
@@ -75,6 +76,7 @@ tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Backward Shot/PathFollow3D"]
collision_layer = 44
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1

View File

@@ -44,6 +44,7 @@ tilt_enabled = false
[node name="HitBox" type="RigidBody3D" parent="Forward Shot/PathFollow3D"]
collision_layer = 44
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
@@ -76,6 +77,7 @@ tilt_enabled = false
[node name="HitBox" type="RigidBody3D" parent="Backward Shot/PathFollow3D"]
transform = Transform3D(0.999999, 0, 0.00207308, 0, 1, 0, -0.00207308, 0, 0.999999, 0.00236542, -1, -0.53373)
collision_layer = 44
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1

View File

@@ -226,7 +226,7 @@ _speed = 1.5
[node name="Pivot" type="Node3D" parent="."]
[node name="Sprite" type="AnimatedSprite3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.51107, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05046, 0)
billboard = 1
sprite_frames = SubResource("SpriteFrames_h2iud")
animation = &"WalkSide"

View File

@@ -8,6 +8,7 @@ public partial class CapricornControls : Character
public override void _Ready()
{
base._Ready();
Position = OwnerPlayer.SpawnPoint.Position;
_sprite = GetNode<AnimatedSprite3D>("Pivot/Sprite");
}
@@ -88,7 +89,8 @@ public partial class CapricornControls : Character
await ToSignal(GetTree().CreateTimer(1.0f), "timeout");
var projectile = _fireProjectile.Instantiate<Node3D>();
projectile.Position = Position;
GetParent().AddChild(projectile);
if (GetParent() != null)
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;
}
@@ -100,7 +102,8 @@ public partial class CapricornControls : Character
await ToSignal(GetTree().CreateTimer(1.0f), "timeout");
var projectile = _altFireProjectile.Instantiate<Node3D>();
projectile.Position = Position;
GetParent().AddChild(projectile);
if (GetParent() != null)
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;
}
@@ -130,7 +133,6 @@ public partial class CapricornControls : Character
public new void OnHit(Node3D node)
{
if (this != null)
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
}
}

View File

@@ -6,7 +6,7 @@
[sub_resource type="Curve3D" id="Curve3D_i1cv2"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.889019, 0.987915, -2.75022, 0, 0, 0, 0, 0, 0, 0.595381, 0.990112, -4.18814, 0, 0, 0, 0, 0, 0, -1.2854, 0.993652, -4.79623),
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.548, 1, -1.274, 0, 0, 0, 0, 0, 0, 0.389, 1, -2.248, 0, 0, 0, 0, 0, 0, -0.28, 1, -2.846),
"tilts": PackedFloat32Array(0, 0, 0, 0)
}
point_count = 4
@@ -27,7 +27,7 @@ _soundEffect = ExtResource("2_u4aoe")
_projectileSpeed = 4.0
[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"]
transform = Transform3D(0.95152, 0.00128605, -0.30758, 1.16415e-10, 0.999991, 0.00418113, 0.307582, -0.00397844, 0.951511, 0, 1, 0)
transform = Transform3D(0.918621, 0, -0.395136, 0, 1, 0, 0.395137, 0, 0.91862, 0, 1, 0)
loop = false
tilt_enabled = false

View File

@@ -4,9 +4,9 @@
[ext_resource type="Texture2D" uid="uid://cdryxdasvun4r" path="res://Textures/Projectiles/Projectile_Scorpio.png" id="2_6mabu"]
[ext_resource type="AudioStream" uid="uid://ce40y3hln3twm" path="res://Audio/SFX/grass cutter.wav" id="2_qmvk7"]
[sub_resource type="Curve3D" id="Curve3D_ocip8"]
[sub_resource type="Curve3D" id="Curve3D_h0dr3"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -0.889, 0.988, -2.75, 0, 0, 0, 0, 0, 0, -0.595, 0.99, -4.188, 0, 0, 0, 0, 0, 0, 1.285, 0.994, -4.796),
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -0.548, 1, -1.274, 0, 0, 0, 0, 0, 0, -0.389, 1, -2.248, 0, 0, 0, 0, 0, 0, 0.28, 1, -2.846),
"tilts": PackedFloat32Array(0, 0, 0, 0)
}
point_count = 4
@@ -19,7 +19,7 @@ radius = 0.272422
[node name="CutterShot" type="Path3D" parent="." node_paths=PackedStringArray("_sprite")]
top_level = true
curve = SubResource("Curve3D_ocip8")
curve = SubResource("Curve3D_h0dr3")
script = ExtResource("1_7xtlh")
_sprite = NodePath("PathFollow3D/RigidBody3D/CollisionShape3D/Sprite3D")
Cooldown = 0.7
@@ -27,7 +27,7 @@ _soundEffect = ExtResource("2_qmvk7")
_projectileSpeed = 4.0
[node name="PathFollow3D" type="PathFollow3D" parent="CutterShot"]
transform = Transform3D(0.951515, -0.00127716, 0.307596, 1.16415e-10, 0.999991, 0.00415203, -0.307599, -0.00395073, 0.951506, 0, 1, 0)
transform = Transform3D(0.918621, 0, 0.395136, 0, 1, 0, -0.395137, 0, 0.91862, 0, 1, 0)
loop = false
tilt_enabled = false