looping music , transition speed up, enemy spped up

This commit is contained in:
GameJammer
2023-09-14 20:47:37 -07:00
parent af3fc06e12
commit 549aa9f7ac
20 changed files with 428 additions and 417 deletions

View File

@@ -29,9 +29,9 @@ public partial class Player : Node3D
public override void _Ready()
{
foreach (var character in PlayableCharacterScenes)
{
CharactersLeftOnStage.Add(character);
}
foreach (var character in PlayableCharacterScenes)
{
CharactersLeftOnStage.Add(character);
}
}
}

View File

@@ -1,4 +1,4 @@
using Godot;
using Godot;
public partial class Projectile : Node3D
{
@@ -18,44 +18,44 @@ public partial class Projectile : Node3D
public override void _EnterTree()
{
Speed = _projectileSpeed;
Speed = _projectileSpeed;
}
public override void _PhysicsProcess(double delta)
{
var pathFollow = GetNode<PathFollow3D>("PathFollow3D");
pathFollow.Progress += Speed * (float)delta;
if (pathFollow.ProgressRatio > 0.98f)
Delete();
var pathFollow = GetNode<PathFollow3D>("PathFollow3D");
pathFollow.Progress += Speed * (float)delta;
if (pathFollow.ProgressRatio > 0.98f)
Delete();
}
public void OnProjectileHit(Node node)
{
if (node is BasicEnemy basicEnemy)
basicEnemy.Call(BasicEnemy.MethodName.OnEnemyHit, node);
Delete();
if (node is BasicEnemy basicEnemy)
basicEnemy.Call(BasicEnemy.MethodName.OnEnemyHit, node);
Delete();
}
public void OnPlayerHit(Node node)
{
SetPhysicsProcess(false);
SetPhysicsProcess(false);
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
{
GD.Print("Player hit: " + character.Name);
character.Call(Character.MethodName.OnHit, this);
}
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
{
GD.Print("Player hit: " + character.Name);
character.Call(Character.MethodName.OnHit, this);
}
QueueFree();
QueueFree();
}
public void Delete()
{
if (!isDeleted)
{
isDeleted = true;
QueueFree();
}
if (!isDeleted)
{
isDeleted = true;
QueueFree();
}
}
public float Speed { get; private set; }