From 1bf39aaa0d736b1976a32030fd1c18e0eedf1781 Mon Sep 17 00:00:00 2001 From: realtradam Date: Fri, 14 May 2021 20:05:49 -0400 Subject: incorperating ECS into dragonruby --- app/ECS/systems/00_movement.rb | 19 +++++++++++-------- app/ECS/systems/01_flying.rb | 12 +++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'app/ECS/systems') diff --git a/app/ECS/systems/00_movement.rb b/app/ECS/systems/00_movement.rb index ced0343..9d8029a 100644 --- a/app/ECS/systems/00_movement.rb +++ b/app/ECS/systems/00_movement.rb @@ -3,18 +3,21 @@ class ECS class Movement def self.run ECS::Components::TestComponent.data.each do |key, data| - puts "Entity ID: #{key}" unless (ECS::Components::Based.id - ECS::Entity.signatures[key]).zero? unless (ECS::Components::Based.id & ECS::Entity.signatures[key]).zero? - puts "Based Data: " - puts "eks: #{ECS::Components::Based.data[key].x += 2}" - puts "why: #{ECS::Components::Based.data[key].y += 2}" + #puts "Based Data: " + #puts "eks: #{ECS::Components::Based.data[key].x += 2}" + #puts "why: #{ECS::Components::Based.data[key].y += 2}" + ECS::Components::Based.data[key].x += 2 + ECS::Components::Based.data[key].y += 2 end end - puts "Movement:" - puts "x: #{data.x += 1}" - puts "y: #{data.y += 1}" - puts "---" + #puts "Movement:" + #puts "x: #{data.x += 1}" + #puts "y: #{data.y += 1}" + data.x += 1 + data.y += 1 + #puts "---" end end end diff --git a/app/ECS/systems/01_flying.rb b/app/ECS/systems/01_flying.rb index 493e999..799398b 100644 --- a/app/ECS/systems/01_flying.rb +++ b/app/ECS/systems/01_flying.rb @@ -4,11 +4,13 @@ class ECS def self.run ECS::Components::Based.data.each do |key, data| if ECS::Components::Based.id == ECS::Entity.signatures[key] - puts "Entity ID: #{key}" - puts "ONLY Based Data: " - puts "eks: #{ECS::Components::Based.data[key].x += 3}" - puts "why: #{ECS::Components::Based.data[key].y += 3}" - puts "---" + #puts "Entity ID: #{key}" + #puts "ONLY Based Data: " + #puts "eks: #{ECS::Components::Based.data[key].x += 3}" + #puts "why: #{ECS::Components::Based.data[key].y += 3}" + #puts "---" + data.x += 3 + data.y += 3 end end end -- cgit v1.2.3