mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-22 03:53:48 +00:00
Gamemanager in bullet
This commit is contained in:
parent
a9b2c8c873
commit
1ee8f085e8
6 changed files with 92 additions and 13 deletions
|
|
@ -17,6 +17,8 @@ public partial class Barrel : Area2D, IDestructible
|
|||
[Export] public PackedScene ExplosionParticles { get; set; }
|
||||
[Export] public BulletResource ExplosionData { get; set; }
|
||||
|
||||
private GameManager _gameManager;
|
||||
|
||||
private float _currentHealth = 0f;
|
||||
|
||||
private bool _isDestroyed = false;
|
||||
|
|
@ -24,6 +26,7 @@ public partial class Barrel : Area2D, IDestructible
|
|||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
_gameManager = this.GetGameManager();
|
||||
_currentHealth = Health;
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +51,7 @@ public partial class Barrel : Area2D, IDestructible
|
|||
var explosion = this.CreateSibling<Bullet>(ExplosionData.BulletScene);
|
||||
explosion.Speed = 0;
|
||||
|
||||
explosion.Initialize(ExplosionData.MakeBullet(this.GlobalPosition));
|
||||
explosion.Initialize(ExplosionData.MakeBullet(this.GlobalPosition), _gameManager);
|
||||
}
|
||||
|
||||
private void ApplyExplosionDamage()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue