diff options
| author | Arnold <[email protected]> | 2021-12-26 18:39:15 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-26 18:39:15 -0500 |
| commit | b7dea8016b5b1328808e28b76cc12343907de63e (patch) | |
| tree | 5339c23bbde03c4d6c8c79d96b2033ab9e838ec0 /app/systems/death.rb | |
| parent | f70283e5ad5f5a5744ca0695a184f72f88803aca (diff) | |
| download | SteelWings-b7dea8016b5b1328808e28b76cc12343907de63e.tar.gz SteelWings-b7dea8016b5b1328808e28b76cc12343907de63e.zip | |
implement ai randomizer, gameover screen, and other bug fixes
* Cleaned up factory. Fixed most bugs with death(last bug should be with move camera).
* check if player entity is nil before shooting or moving camera
* implement ai randomizer
* separate button click detection to new system
* implement gameover screen with button to return to menu
* use reverse_each instead of cloning
Co-authored-by: realtradam <[email protected]>
Diffstat (limited to 'app/systems/death.rb')
| -rw-r--r-- | app/systems/death.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/systems/death.rb b/app/systems/death.rb index 7c10212..edeb493 100644 --- a/app/systems/death.rb +++ b/app/systems/death.rb @@ -2,10 +2,12 @@ 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| + hp.entities[0].components.each do |manager, manager_array| + if manager.equal?(FF::Cmp::SingletonPlayer) + FF::Sys::EndGame.call + end next if manager.equal?(FF::Cmp::Hp) - manager_array.each do |component| + manager_array.reverse_each do |component| next if component.respond_to?(:singleton) component.delete end |
