Capricorn laser done
This commit is contained in:
@@ -96,11 +96,11 @@ public partial class Capricorn : Character1
|
||||
private async void Fire()
|
||||
{
|
||||
IsShooting = true;
|
||||
//var projectile = _fireProjectile.Instantiate<Projectile>();
|
||||
//projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
//GetParent().AddChild(projectile);
|
||||
CanShoot = false;
|
||||
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
|
||||
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
|
||||
var projectile = _fireProjectile.Instantiate<Projectile>();
|
||||
projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
GetParent().AddChild(projectile);
|
||||
CanShoot = true;
|
||||
IsShooting = false;
|
||||
}
|
||||
@@ -108,11 +108,11 @@ public partial class Capricorn : Character1
|
||||
private async void AltFire()
|
||||
{
|
||||
IsShooting = true;
|
||||
//var projectile = _altFireProjectile.Instantiate<Projectile>();
|
||||
//projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
//GetParent().AddChild(projectile);
|
||||
CanShoot = false;
|
||||
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
|
||||
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
|
||||
var projectile = _altFireProjectile.Instantiate<Projectile>();
|
||||
projectile.Position = Position + new Vector3(0f, 1f, 0f);
|
||||
GetParent().AddChild(projectile);
|
||||
CanShoot = true;
|
||||
IsShooting = false;
|
||||
}
|
||||
|
||||
12
Scripts/CapricornLaserShot.cs
Normal file
12
Scripts/CapricornLaserShot.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Godot;
|
||||
using System.Linq;
|
||||
|
||||
public partial class CapricornLaserShot : Projectile
|
||||
{
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
var shots = GetChildren().OfType<RigidBody3D>();
|
||||
shots.ElementAt(0).Translate(new Vector3(0, 0, Speed * -(float)delta));
|
||||
shots.ElementAt(1).Translate(new Vector3(0, 0, Speed * (float)delta));
|
||||
}
|
||||
}
|
||||
@@ -161,8 +161,11 @@ public partial class GameManager : Node
|
||||
foreach (var player in players)
|
||||
GetTree().Root.RemoveChild(player);
|
||||
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
var projectiles = GetTree().Root.GetChildren().OfType<Projectile>();
|
||||
foreach (var projectile in projectiles)
|
||||
GetTree().Root.RemoveChild(projectile);
|
||||
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadNextLevel(_levelIndex++);
|
||||
|
||||
foreach (var player in Players)
|
||||
|
||||
@@ -36,6 +36,7 @@ public partial class StageGUI : Control
|
||||
return;
|
||||
|
||||
player.IsSelectingCharacter = true;
|
||||
ChangeBG(player);
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
|
||||
Reference in New Issue
Block a user