summaryrefslogtreecommitdiffhomepage
path: root/app/lib/components
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/components')
-rw-r--r--app/lib/components/00_renderable.rb16
-rw-r--r--app/lib/components/01_sprite.rb44
-rw-r--r--app/lib/components/02_label.rb27
-rw-r--r--app/lib/components/03_player_control.rb21
-rw-r--r--app/lib/components/04_map.rb21
-rw-r--r--app/lib/components/05_interactable.rb16
-rw-r--r--app/lib/components/06_collidable.rb22
-rw-r--r--app/lib/components/07_battle.rb4
-rw-r--r--app/lib/components/07_indoor.rb4
-rw-r--r--app/lib/components/07_overworld.rb16
-rw-r--r--app/lib/components/debug_singleton.rb13
11 files changed, 0 insertions, 204 deletions
diff --git a/app/lib/components/00_renderable.rb b/app/lib/components/00_renderable.rb
deleted file mode 100644
index 3971c8c..0000000
--- a/app/lib/components/00_renderable.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class Components
- # If an entity can be rendered on screen
- class Renderable < Helper::BaseComponent
- attr_accessor :z
-
- def initialize
- @z = 0
- end
-
- def set(**opts)
- opts.each do |key, value|
- self.send "#{key}=", value
- end
- end
- end
-end
diff --git a/app/lib/components/01_sprite.rb b/app/lib/components/01_sprite.rb
deleted file mode 100644
index 8d30cdf..0000000
--- a/app/lib/components/01_sprite.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-class Components
- # If an entity can be rendered on screen
- class Sprite < Helper::BaseComponent
-
- attr_accessor :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
-
- def set(x: @x, y: @y, w: @w, h: @h, path: @path, angle: @angle, a: @a, r: @r, g: @g, b: @b,
- source_x: @source_x, source_y: @source_y, source_w: @source_w, source_h: @source_h,
- tile_x: @tile_x, tile_y: @tile_y, tile_w: @tile_w, tile_h: @tile_h,
- flip_horizontally: @flip_horizontally, flip_vertically: @flip_vertically,
- angle_anchor_x: @angle_anchor_x, angle_anchor_y: @angle_anchor_y)
- {x: @x = x,
- y: @y = y,
- w: @w = w,
- h: @h = h,
- path: @path = path,
- angle: @angle = angle,
- a: @a = a,
- r: @r = r,
- g: @g = g,
- b: @b = b,
- source_x: @source_x = source_x,
- source_y: @source_y = source_y,
- source_w: @source_w = source_w,
- source_h: @source_h = source_h,
- tile_x: @tile_x = tile_x,
- tile_y: @tile_y = tile_y,
- tile_w: @tile_w = tile_w,
- tile_h: @tile_h = tile_h,
- flip_horizontally: @flip_horizontally = flip_horizontally,
- flip_vertically: @flip_vertically = flip_vertically,
- angle_anchor_x: @angle_anchor_x = angle_anchor_x,
- angle_anchor_y: @angle_anchor_y = angle_anchor_y}
- end
-
- def primative_marker
- :sprite
- end
- end
-end
diff --git a/app/lib/components/02_label.rb b/app/lib/components/02_label.rb
deleted file mode 100644
index 13544b7..0000000
--- a/app/lib/components/02_label.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-class Components
- # A dragonruby label wrapper
- class Label < Helper::BaseComponent
-
- attr_accessor :x, :y, :text, :size_enum, :alignment_enum,
- :a, :r, :g, :b, :font, :vertical_alignment_enum
-
- def set(x: @x, y: @y, text: @text, size_enum: @size_enum, alignment_enum: @alignment_enum,
- a: @a, r: @r, g: @g, b: @b, font: @font, vertical_alignment_enum: @vertical_alignment_enum)
- {x: @x = x,
- y: @y = y,
- text: @text = text,
- size_enum: @size_enum = size_enum,
- alignment_enum: @alignment_enum = alignment_enum,
- r: @r = r,
- g: @g = g,
- b: @b = b,
- a: @a = a,
- font: @font = font,
- vertical_alignment_enum: @vertical_alignment_enum = vertical_alignment_enum }
- end
-
- def primative_marker
- :label
- end
- end
-end
diff --git a/app/lib/components/03_player_control.rb b/app/lib/components/03_player_control.rb
deleted file mode 100644
index d5d8f7a..0000000
--- a/app/lib/components/03_player_control.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class Components
- # Gives control(keyboard or otherwise) over an object
- class PlayerControl < Helper::BaseComponent
- attr_accessor :north, :south, :east, :west, :interact, :menu
-
- def initialize
- @north = 'up'
- @south = 'down'
- @east = 'right'
- @west = 'left'
- @interact = 'space'
- @menu = 'enter'
- end
-
- def set(**opts)
- opts.each do |key, value|
- send "#{key}=", value
- end
- end
- end
-end
diff --git a/app/lib/components/04_map.rb b/app/lib/components/04_map.rb
deleted file mode 100644
index 7700e9f..0000000
--- a/app/lib/components/04_map.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class Components
- # dragonruby label wrapper
- class Map < Helper::BaseComponent
-
- attr_accessor :json_name, :json, :x, :y, :tilewidth, :tileheight, :a, :r, :g, :b
-
- def set(json_name: @json_name, x: @x, y: @y, tilewidth: @tilewidth,
- tileheight: @tileheight, a: @a, r: @r, g: @g, b: @b)
- { json_name: @json_name = json_name,
- json: @json = Helper.get_json_tiles(json_name),
- x: @x = x,
- y: @y = y,
- tilewidth: @tilewidth = tilewidth,
- tileheight: @tileheight = tileheight,
- r: @r = r,
- g: @g = g,
- b: @b = b,
- a: @a = a }
- end
- end
-end
diff --git a/app/lib/components/05_interactable.rb b/app/lib/components/05_interactable.rb
deleted file mode 100644
index 636a216..0000000
--- a/app/lib/components/05_interactable.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class Components
- # If an entity can be rendered on screen
- class Interactable < Helper::BaseComponent
- attr_accessor :z
-
- def initialize
- @z = z
- end
-
- def set(**opts)
- opts.each do |key, value|
- self.send "#{key}=", value
- end
- end
- end
-end
diff --git a/app/lib/components/06_collidable.rb b/app/lib/components/06_collidable.rb
deleted file mode 100644
index 76ce51e..0000000
--- a/app/lib/components/06_collidable.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class Components
- # If an entity can be rendered on screen
- class Collidable < Helper::BaseComponent
- class <<self
- def add(entity_id)
- super(entity_id)
- #add to grid?
- end
- end
- attr_accessor :grid
-
- def initialize
- @grid = [[]]
- end
-
- def set(**opts)
- opts.each do |key, value|
- self.send "#{key}=", value
- end
- end
- end
-end
diff --git a/app/lib/components/07_battle.rb b/app/lib/components/07_battle.rb
deleted file mode 100644
index b4ef622..0000000
--- a/app/lib/components/07_battle.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-class Components
- class Battle < Helper::Level
- end
-end
diff --git a/app/lib/components/07_indoor.rb b/app/lib/components/07_indoor.rb
deleted file mode 100644
index e409da8..0000000
--- a/app/lib/components/07_indoor.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-class Components
- class Indoor < Helper::Level
- end
-end
diff --git a/app/lib/components/07_overworld.rb b/app/lib/components/07_overworld.rb
deleted file mode 100644
index 55ab38a..0000000
--- a/app/lib/components/07_overworld.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class Components
- class Overworld < Helper::Level
- attr_accessor :x, :y
-
- def initialize
- @x = 0
- @y = 0
- end
-
- def set(**opts)
- opts.each do |key, value|
- self.send "#{key}=", value
- end
- end
- end
-end
diff --git a/app/lib/components/debug_singleton.rb b/app/lib/components/debug_singleton.rb
deleted file mode 100644
index f298172..0000000
--- a/app/lib/components/debug_singleton.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class Components
- # If an entity can be rendered on screen
- class DebugSingleton
- class <<self
- @data = false
- attr_accessor :data
-
- def id
- 0
- end
- end
- end
-end