diff options
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 +) |
