looping music , transition speed up, enemy spped up
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://uwia12i7yykb"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://uwia12i7yykb"]
|
||||
|
||||
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_4uor3"]
|
||||
[ext_resource type="Texture2D" uid="uid://bunon01jmxhbx" path="res://Textures/Projectiles/Layer 2.png" id="1_a70u8"]
|
||||
@@ -14,13 +14,21 @@ point_count = 10
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_g5fdd"]
|
||||
size = Vector3(0.553759, 1.22067, 1.58866)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8nabx"]
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(0.47451, 0.0196078, 0.0862745, 1)
|
||||
emission = Color(0.905882, 0.254902, 0, 1)
|
||||
emission_energy_multiplier = 19.32
|
||||
subsurf_scatter_strength = 0.07
|
||||
backlight = Color(1, 0, 0, 1)
|
||||
|
||||
[node name="Path3D" type="Path3D"]
|
||||
curve = SubResource("Curve3D_n05rs")
|
||||
script = ExtResource("1_4uor3")
|
||||
_projectileSpeed = 5.0
|
||||
|
||||
[node name="PathFollow3D" type="PathFollow3D" parent="."]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, 10)
|
||||
transform = Transform3D(-1, 0, -1.50996e-07, 0, 1, 0, 1.50996e-07, 0, -1, 1, 1, 10)
|
||||
progress = 27.0
|
||||
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="PathFollow3D"]
|
||||
@@ -39,6 +47,8 @@ shape = SubResource("BoxShape3D_g5fdd")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="PathFollow3D/RigidBody3D/CollisionShape3D"]
|
||||
transform = Transform3D(-2.18557e-08, 0, 0.5, 0, 0.5, 0, -0.5, 0, -2.18557e-08, 0, 0, 0)
|
||||
material_override = SubResource("StandardMaterial3D_8nabx")
|
||||
modulate = Color(0.901961, 0.12549, 0.34902, 1)
|
||||
axis = 1
|
||||
texture = ExtResource("1_a70u8")
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Godot;
|
||||
using Godot;
|
||||
|
||||
public partial class PyramidAttack : Node3D
|
||||
{
|
||||
@@ -9,26 +9,26 @@ public partial class PyramidAttack : Node3D
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
_animationPlayer.AnimationFinished += Delete;
|
||||
_animationPlayer.AnimationFinished += 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();
|
||||
isDeleted = true;
|
||||
QueueFree();
|
||||
isDeleted = true;
|
||||
}
|
||||
|
||||
public void Delete(StringName name)
|
||||
{
|
||||
if (!isDeleted)
|
||||
QueueFree();
|
||||
isDeleted = true;
|
||||
if (!isDeleted)
|
||||
QueueFree();
|
||||
isDeleted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,46 +16,46 @@ public partial class GodCircuit : Node3D
|
||||
|
||||
private void OnHit(Node3D node)
|
||||
{
|
||||
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
|
||||
{
|
||||
GD.Print("Player hit: " + character.Name);
|
||||
character.Call(Character.MethodName.OnHit, node);
|
||||
}
|
||||
else
|
||||
{
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
if (hpComponent.CurrentHP > 0)
|
||||
{
|
||||
GD.Print("Hit");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(1);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
|
||||
{
|
||||
GD.Print("Player hit: " + character.Name);
|
||||
character.Call(Character.MethodName.OnHit, node);
|
||||
}
|
||||
else
|
||||
{
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
if (hpComponent.CurrentHP > 0)
|
||||
{
|
||||
GD.Print("Hit");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(1);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
{
|
||||
EmitSignal(SignalName.DestroyRemainingOrbs);
|
||||
_animationPlayer.Play("OnDeath");
|
||||
_animationPlayer.AnimationFinished += OnGameFinished;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
{
|
||||
EmitSignal(SignalName.DestroyRemainingOrbs);
|
||||
_animationPlayer.Play("OnDeath");
|
||||
_animationPlayer.AnimationFinished += OnGameFinished;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBossOrbDestroyed()
|
||||
{
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(60);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(60);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
hpComponent.CurrentHP = 1;
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
hpComponent.CurrentHP = 1;
|
||||
}
|
||||
|
||||
private void OnGameFinished(StringName animationName)
|
||||
{
|
||||
GD.Print("On game ending");
|
||||
EmitSignal(SignalName.OnGameEnding);
|
||||
QueueFree();
|
||||
GD.Print("On game ending");
|
||||
EmitSignal(SignalName.OnGameEnding);
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,22 +4,22 @@ using System.Linq;
|
||||
public partial class MeleeEnemy : BasicEnemy
|
||||
{
|
||||
[Export]
|
||||
private float _speed = 0.4f;
|
||||
private float _speed = 0.8f;
|
||||
private bool _targetingPlayer = false;
|
||||
[Export]
|
||||
private double _distanceToPlayer = 3;
|
||||
private double _distanceToPlayer = 4;
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
var players = GetTree().GetNodesInGroup("Player").Cast<Character>();
|
||||
if (players.Any())
|
||||
{
|
||||
var target = players.OrderBy(x => Position.DistanceTo(x.Position)).FirstOrDefault();
|
||||
if (_targetingPlayer || Position.DistanceTo(target.Position) < _distanceToPlayer)
|
||||
{
|
||||
Position = Position.MoveToward(target.Position, _speed * (float)delta);
|
||||
_targetingPlayer = true;
|
||||
}
|
||||
}
|
||||
var players = GetTree().GetNodesInGroup("Player").Cast<Character>();
|
||||
if (players.Any())
|
||||
{
|
||||
var target = players.OrderBy(x => Position.DistanceTo(x.Position)).FirstOrDefault();
|
||||
if (_targetingPlayer || Position.DistanceTo(target.Position) < _distanceToPlayer)
|
||||
{
|
||||
Position = Position.MoveToward(target.Position, _speed * (float)delta);
|
||||
_targetingPlayer = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user