summaryrefslogtreecommitdiffhomepage
path: root/app/tick.rb
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/tick.rb
parent6a2996ceae968029be26ed7ebae8785dcfe877d2 (diff)
downloadtypemon-code-1bf39aaa0d736b1976a32030fd1c18e0eedf1781.tar.gz
typemon-code-1bf39aaa0d736b1976a32030fd1c18e0eedf1781.zip
incorperating ECS into dragonruby
Diffstat (limited to 'app/tick.rb')
-rw-r--r--app/tick.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/tick.rb b/app/tick.rb
new file mode 100644
index 0000000..072bf48
--- /dev/null
+++ b/app/tick.rb
@@ -0,0 +1,27 @@
+
+=begin
+files = ""
+files = `ls -B1 #{__dir__}`
+
+File.write("#{__dir__}/_", (files.split - ["_"]).map{|file| "require 'lib/#{libname}/#{file}'"}.join("\n"))
+=end
+move = '0001'.to_i(2)
+base = '0010'.to_i(2)
+both = '0011'.to_i(2)
+@thing0 = ECS::Entity.new(move)
+puts @thing0
+ECS::Entity.new(base)
+ECS::Entity.new(both)
+
+def tick args
+ ECS::Systems.constants.each do |constant|
+ ECS::Systems::const_get(constant).run
+ end
+ args.outputs.labels << [640, 500, ECS::Components::TestComponent.data[@thing0.id].x, 5, 1]
+ args.outputs.labels << [640, 460, @thing0, 5, 1]
+ args.outputs.labels << [640, 420, 'Join the Discord! http://discord.dragonruby.org', 5, 1]
+ args.outputs.sprites << [576, 280, 128, 101, 'dragonruby.png']
+ @render = Sprite.objects[1] if args.inputs.keyboard.key_held.a
+ @render = Sprite.objects[0] if args.inputs.keyboard.key_held.s
+ args.outputs.sprites << @render
+end