Zombie death and damage indicators
This commit is contained in:
parent
bffb012a26
commit
b524f97e7f
14 changed files with 324 additions and 117 deletions
|
|
@ -2,6 +2,9 @@ using Godot;
|
|||
using Newlon.Components.Level;
|
||||
using Newlon.Components.Zombies;
|
||||
|
||||
namespace Newlon.Components;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class FallParticle : RigidBody2D
|
||||
{
|
||||
[Export] private RuntimeZombieData data;
|
||||
|
|
@ -19,10 +22,11 @@ public partial class FallParticle : RigidBody2D
|
|||
}
|
||||
Callable.From(() =>
|
||||
{
|
||||
Reparent(PoolContainer.Instance.Zombies);
|
||||
Reparent(PoolContainer.Instance.Particles);
|
||||
float rng_angle = Mathf.DegToRad((float)GD.RandRange(minAngle, maxAngle));
|
||||
float rng_torque = Mathf.DegToRad((float)GD.RandRange(minTorque, maxTorque));
|
||||
ApplyImpulse(new Vector2(Mathf.Sin(rng_angle) * Impulse, Mathf.Cos(rng_angle) * Impulse));
|
||||
if (Impulse != 0)
|
||||
ApplyImpulse(new Vector2(Mathf.Sin(rng_angle) * Impulse, Mathf.Cos(rng_angle) * Impulse));
|
||||
ApplyTorqueImpulse(rng_torque);
|
||||
}).CallDeferred();
|
||||
var tween = CreateTween();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue