mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-16 08:33:55 +00:00
Bullet resource
This commit is contained in:
parent
76221ca7a6
commit
07f6e58ebd
19 changed files with 236 additions and 50 deletions
|
|
@ -2,6 +2,7 @@ using Godot;
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Resources;
|
||||
|
||||
public partial class Barrel : Area2D, IDestructible
|
||||
{
|
||||
|
|
@ -14,8 +15,7 @@ public partial class Barrel : Area2D, IDestructible
|
|||
[Export] public PackedScene DebrisScene { get; set; }
|
||||
|
||||
[Export] public PackedScene ExplosionParticles { get; set; }
|
||||
|
||||
[Export] public PackedScene ExplosionScene { get; set; }
|
||||
[Export] public BulletResource ExplosionData { get; set; }
|
||||
|
||||
private float _currentHealth = 0f;
|
||||
|
||||
|
|
@ -43,11 +43,12 @@ public partial class Barrel : Area2D, IDestructible
|
|||
|
||||
private void CreateExplosion()
|
||||
{
|
||||
if (ExplosionScene == null) return;
|
||||
if (ExplosionData == null) return;
|
||||
|
||||
var explosion = this.CreateSibling<Bullet>(ExplosionScene);
|
||||
var explosion = this.CreateSibling<Bullet>(ExplosionData.BulletScene);
|
||||
explosion.Speed = 0;
|
||||
|
||||
explosion.Initialize(ExplosionData.MakeBullet(this.GlobalPosition));
|
||||
}
|
||||
|
||||
private void ApplyExplosionDamage()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue