This commit is contained in:
2023-09-05 01:52:10 -07:00
parent c645c56fb8
commit b9e66d9f93
42 changed files with 780 additions and 95 deletions

View File

@@ -100,6 +100,7 @@ public partial class Capricorn : Character1
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;
@@ -112,6 +113,7 @@ public partial class Capricorn : Character1
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;

View File

@@ -98,6 +98,7 @@ public partial class Capricorn2 : Character2
IsShooting = true;
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
@@ -110,6 +111,7 @@ public partial class Capricorn2 : Character2
IsShooting = true;
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");

View File

@@ -61,6 +61,7 @@ public partial class Character1 : Character
{
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
@@ -71,6 +72,7 @@ public partial class Character1 : Character
{
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");

24
Scripts/Level3.cs Normal file
View File

@@ -0,0 +1,24 @@
using Godot;
public partial class Level3 : Node3D
{
private int _numberOfHits = 3;
private MeshInstance3D _door;
public override void _Ready()
{
_door = GetNode<MeshInstance3D>("Door");
}
private void OnDoorHit(Node3D node)
{
_numberOfHits--;
GD.Print(_numberOfHits);
if (_numberOfHits == 0)
{
_door.Hide();
_door.QueueFree();
_door = null;
}
}
}

View File

@@ -40,6 +40,11 @@ public partial class MainMenu : Node2D
_animationPlayer.AnimationFinished += OnAnimationFinishedCallTwoPlayerStart;
}
private void OnQuitButtonPressed()
{
GetTree().Quit();
}
private void OnAnimationFinishedCallTwoPlayerStart(StringName animationName)
{
if (animationName == "FirstLevel")

15
Scripts/MegamiBeamShot.cs Normal file
View File

@@ -0,0 +1,15 @@
using Godot;
public partial class MegamiBeamShot : Projectile
{
public override void _Ready()
{
Rotation = ParentCharacter.Rotation;
GD.Print(Rotation);
}
public override void _Process(double delta)
{
Translate(new Vector3(0, 0, -Speed * (float)delta));
}
}

View File

@@ -6,6 +6,8 @@ public partial class Projectile : Node3D
[Export]
public double Cooldown { get; protected set; }
public Character ParentCharacter;
[Export]
private float _projectileSpeed = 1f;