diff options
| author | realtradam <[email protected]> | 2021-12-19 19:06:50 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-12-19 19:06:50 -0500 |
| commit | 844d8c194b48055ba60be4d185ad9ab688cce92a (patch) | |
| tree | 8058c12295b9a6e03a678be2b50b9b328291c0e0 /app/systems/death.rb | |
| parent | bd645871ff96a45c23c05f6fc7a82ac1e2749616 (diff) | |
| download | SteelWings-844d8c194b48055ba60be4d185ad9ab688cce92a.tar.gz SteelWings-844d8c194b48055ba60be4d185ad9ab688cce92a.zip | |
Bullets, Health, Collision systems implemented. Renamed plane sprites.
Diffstat (limited to 'app/systems/death.rb')
| -rw-r--r-- | app/systems/death.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/systems/death.rb b/app/systems/death.rb new file mode 100644 index 0000000..d9cd792 --- /dev/null +++ b/app/systems/death.rb @@ -0,0 +1,20 @@ +FF::Scn::BoidRules.add( + FF::Sys.new("Death", priority: 200) do + FF::Cmp::Hp.each do |hp| + if hp.health <= 0 + component_hash = hp.entities[0].components.clone + component_hash.each_pair do |manager, manager_array| + next if manager.equal?(FF::Cmp::SingletonCamera) + next if manager.equal?(FF::Cmp::Hp) + next if manager.equal?(FF::Cmp::DebugVectorArrow) + manager_array.each do |component| + # unless singleton + component.delete + end + end + hp.entities[0].delete + hp.delete + end + end + end +) |
