Oops
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
24
Scripts/Level3.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
15
Scripts/MegamiBeamShot.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ public partial class Projectile : Node3D
|
||||
[Export]
|
||||
public double Cooldown { get; protected set; }
|
||||
|
||||
public Character ParentCharacter;
|
||||
|
||||
[Export]
|
||||
private float _projectileSpeed = 1f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user