summaryrefslogtreecommitdiffhomepage
path: root/app/ECS/systems
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-05-14 20:05:49 -0400
committerrealtradam <[email protected]>2021-05-14 20:05:49 -0400
commit1bf39aaa0d736b1976a32030fd1c18e0eedf1781 (patch)
tree70bc2e70bda09eba2356ed3a67cdbe9efa2b2dd6 /app/ECS/systems
parent6a2996ceae968029be26ed7ebae8785dcfe877d2 (diff)
downloadtypemon-code-1bf39aaa0d736b1976a32030fd1c18e0eedf1781.tar.gz
typemon-code-1bf39aaa0d736b1976a32030fd1c18e0eedf1781.zip
incorperating ECS into dragonruby
Diffstat (limited to 'app/ECS/systems')
-rw-r--r--app/ECS/systems/00_movement.rb19
-rw-r--r--app/ECS/systems/01_flying.rb12
2 files changed, 18 insertions, 13 deletions
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