summaryrefslogtreecommitdiffhomepage
path: root/components
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-05-26 07:41:45 -0400
committerrealtradam <[email protected]>2021-05-26 07:41:45 -0400
commit1531c393a0b8b7c7a0451820fe3905b0b4e71079 (patch)
tree2133bf8614d8cecab84b5fae37561710f9c11375 /components
parent7bec71db2680e0503f39c31047f5f90ca89433df (diff)
downloadFelECS-1531c393a0b8b7c7a0451820fe3905b0b4e71079.tar.gz
FelECS-1531c393a0b8b7c7a0451820fe3905b0b4e71079.zip
dynamic components can be created
Diffstat (limited to 'components')
-rw-r--r--components/00_renderable.rb3
-rw-r--r--components/01_sprite.rb13
-rw-r--r--components/02_label.rb5
-rw-r--r--components/03_player_control.rb5
4 files changed, 26 insertions, 0 deletions
diff --git a/components/00_renderable.rb b/components/00_renderable.rb
index 3971c8c..1d34fbb 100644
--- a/components/00_renderable.rb
+++ b/components/00_renderable.rb
@@ -1,3 +1,5 @@
+FelFlame::Components.new('Renderable', z: 0)
+=begin
class Components
# If an entity can be rendered on screen
class Renderable < Helper::BaseComponent
@@ -14,3 +16,4 @@ class Components
end
end
end
+=end
diff --git a/components/01_sprite.rb b/components/01_sprite.rb
index 8d30cdf..c02a51b 100644
--- a/components/01_sprite.rb
+++ b/components/01_sprite.rb
@@ -1,3 +1,15 @@
+
+FelFlame::Components.new('Sprite', :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b,
+ :source_x, :source_y, :source_w, :source_h,
+ :tile_x, :tile_y, :tile_w, :tile_h,
+ :flip_horizontally, :flip_vertically,
+ :angle_anchor_x, :angle_anchor_y, primative_marker: :sprite)
+
+#Components::Sprite.define_method('primative_marker') do
+# :sprite
+#end
+
+=begin
class Components
# If an entity can be rendered on screen
class Sprite < Helper::BaseComponent
@@ -42,3 +54,4 @@ class Components
end
end
end
+=end
diff --git a/components/02_label.rb b/components/02_label.rb
index 13544b7..f73b12c 100644
--- a/components/02_label.rb
+++ b/components/02_label.rb
@@ -1,3 +1,7 @@
+
+FelFlame::Components.new :Label, :x, :y, :text, :size_enum, :alignment_enum,
+ :a, :r, :g, :b, :font, :vertical_alignment_enum, primative_marker: :label
+=begin
class Components
# A dragonruby label wrapper
class Label < Helper::BaseComponent
@@ -25,3 +29,4 @@ class Components
end
end
end
+end
diff --git a/components/03_player_control.rb b/components/03_player_control.rb
index d5d8f7a..f48b155 100644
--- a/components/03_player_control.rb
+++ b/components/03_player_control.rb
@@ -1,3 +1,7 @@
+
+FelFlame::Components.new :PlayerControl, north: 'up', south: 'down', east: 'right',
+ west: 'left', interact: 'space', menu: 'enter'
+=begin
class Components
# Gives control(keyboard or otherwise) over an object
class PlayerControl < Helper::BaseComponent
@@ -19,3 +23,4 @@ class Components
end
end
end
+=end