diff options
Diffstat (limited to 'app/systems')
| -rw-r--r-- | app/systems/death.rb | 4 | ||||
| -rw-r--r-- | app/systems/debug/debug_render_vector_arrow.rb | 4 | ||||
| -rw-r--r-- | app/systems/rules/separation.rb | 2 | ||||
| -rw-r--r-- | app/systems/start_game.rb | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/app/systems/death.rb b/app/systems/death.rb index d9cd792..7c10212 100644 --- a/app/systems/death.rb +++ b/app/systems/death.rb @@ -4,11 +4,9 @@ FF::Scn::BoidRules.add( 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 + next if component.respond_to?(:singleton) component.delete end end diff --git a/app/systems/debug/debug_render_vector_arrow.rb b/app/systems/debug/debug_render_vector_arrow.rb index ae53d1c..0a0ed62 100644 --- a/app/systems/debug/debug_render_vector_arrow.rb +++ b/app/systems/debug/debug_render_vector_arrow.rb @@ -1,8 +1,8 @@ FF::Sys.new('DebugRenderVectorArrow', priority: 100) do - FF::Cmp::DebugVectorArrow[0].entities.each do |entity| + FF::Cmp::SingletonDebugVectorArrow[0].entities.each do |entity| boid = entity.components[FF::Cmp::Boid][0] sprite = entity.components[FF::Cmp::Sprite][0] - length = FF::Cmp::DebugVectorArrow[0].length + length = FF::Cmp::SingletonDebugVectorArrow[0].length #puts "vx: #{boid.vx}" #puts "cx: #{boid.cx}" boid_x = 0 diff --git a/app/systems/rules/separation.rb b/app/systems/rules/separation.rb index 9e223d2..5aeda8a 100644 --- a/app/systems/rules/separation.rb +++ b/app/systems/rules/separation.rb @@ -14,7 +14,7 @@ FF::Scn::BoidRules.add( end end - #unless separation.entities[0].components[FF::Cmp::DebugVectorArrow].nil? + #unless separation.entities[0].components[FF::Cmp::SingletonDebugVectorArrow].nil? # puts "newvec: #{newvec}" # puts "cx: #{boid_update.cx} cy: #{boid_update.cy}" # puts "vx: #{boid_update.vx} vy: #{boid_update.vy}" diff --git a/app/systems/start_game.rb b/app/systems/start_game.rb index 39cc63c..c197863 100644 --- a/app/systems/start_game.rb +++ b/app/systems/start_game.rb @@ -8,7 +8,7 @@ FF::Sys.new('StartGame', priority: 50 ) do FF::Cmp::Title[0].delete FF::Stg.remove FF::Scn::TitleScreen - debug_arrow = FF::Cmp::DebugVectorArrow.new(length: 5) + debug_arrow = FF::Cmp::SingletonDebugVectorArrow.new(length: 5) position = [ {x: 100, y: 100}, {x: 500, y: 500}, |
