summaryrefslogtreecommitdiffhomepage
path: root/deprecated/components
diff options
context:
space:
mode:
Diffstat (limited to 'deprecated/components')
-rw-r--r--deprecated/components/00_renderable.rb36
-rw-r--r--deprecated/components/01_sprite.rb103
-rw-r--r--deprecated/components/03_player_control.rb47
-rw-r--r--deprecated/components/04_map.rb3
-rw-r--r--deprecated/components/05_interactable.rb4
-rw-r--r--deprecated/components/06_collidable.rb10
-rw-r--r--deprecated/components/07_battle.rb2
-rw-r--r--deprecated/components/07_indoor.rb2
-rw-r--r--deprecated/components/07_overworld.rb4
-rw-r--r--deprecated/components/debug_singleton.rb4
10 files changed, 111 insertions, 104 deletions
diff --git a/deprecated/components/00_renderable.rb b/deprecated/components/00_renderable.rb
index 1d34fbb..32c93b6 100644
--- a/deprecated/components/00_renderable.rb
+++ b/deprecated/components/00_renderable.rb
@@ -1,19 +1,19 @@
-FelFlame::Components.new('Renderable', z: 0)
-=begin
-class Components
- # If an entity can be rendered on screen
- class Renderable < Helper::BaseComponent
- attr_accessor :z
-
- def initialize
- @z = 0
- end
+# frozen_string_literal: true
- def set(**opts)
- opts.each do |key, value|
- self.send "#{key}=", value
- end
- end
- end
-end
-=end
+FelFlame::Components.new('Renderable', z: 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/deprecated/components/01_sprite.rb b/deprecated/components/01_sprite.rb
index c02a51b..4ae6713 100644
--- a/deprecated/components/01_sprite.rb
+++ b/deprecated/components/01_sprite.rb
@@ -1,57 +1,56 @@
+# frozen_string_literal: true
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)
+ :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
+# Components::Sprite.define_method('primative_marker') do
# :sprite
-#end
+# end
-=begin
-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
-=end
+# 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/deprecated/components/03_player_control.rb b/deprecated/components/03_player_control.rb
index f48b155..6414547 100644
--- a/deprecated/components/03_player_control.rb
+++ b/deprecated/components/03_player_control.rb
@@ -1,26 +1,25 @@
+# frozen_string_literal: true
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
- 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
-=end
+ west: 'left', interact: 'space', menu: 'enter'
+# 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/deprecated/components/04_map.rb b/deprecated/components/04_map.rb
index 7700e9f..5d110f0 100644
--- a/deprecated/components/04_map.rb
+++ b/deprecated/components/04_map.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
+
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,
diff --git a/deprecated/components/05_interactable.rb b/deprecated/components/05_interactable.rb
index 636a216..bee91f6 100644
--- a/deprecated/components/05_interactable.rb
+++ b/deprecated/components/05_interactable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Components
# If an entity can be rendered on screen
class Interactable < Helper::BaseComponent
@@ -9,7 +11,7 @@ class Components
def set(**opts)
opts.each do |key, value|
- self.send "#{key}=", value
+ send "#{key}=", value
end
end
end
diff --git a/deprecated/components/06_collidable.rb b/deprecated/components/06_collidable.rb
index 76ce51e..4fde638 100644
--- a/deprecated/components/06_collidable.rb
+++ b/deprecated/components/06_collidable.rb
@@ -1,11 +1,9 @@
+# frozen_string_literal: true
+
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
+ class << self
end
attr_accessor :grid
@@ -15,7 +13,7 @@ class Components
def set(**opts)
opts.each do |key, value|
- self.send "#{key}=", value
+ send "#{key}=", value
end
end
end
diff --git a/deprecated/components/07_battle.rb b/deprecated/components/07_battle.rb
index b4ef622..996c03c 100644
--- a/deprecated/components/07_battle.rb
+++ b/deprecated/components/07_battle.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Components
class Battle < Helper::Level
end
diff --git a/deprecated/components/07_indoor.rb b/deprecated/components/07_indoor.rb
index e409da8..762c239 100644
--- a/deprecated/components/07_indoor.rb
+++ b/deprecated/components/07_indoor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Components
class Indoor < Helper::Level
end
diff --git a/deprecated/components/07_overworld.rb b/deprecated/components/07_overworld.rb
index 55ab38a..cea11f5 100644
--- a/deprecated/components/07_overworld.rb
+++ b/deprecated/components/07_overworld.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Components
class Overworld < Helper::Level
attr_accessor :x, :y
@@ -9,7 +11,7 @@ class Components
def set(**opts)
opts.each do |key, value|
- self.send "#{key}=", value
+ send "#{key}=", value
end
end
end
diff --git a/deprecated/components/debug_singleton.rb b/deprecated/components/debug_singleton.rb
index f298172..e667191 100644
--- a/deprecated/components/debug_singleton.rb
+++ b/deprecated/components/debug_singleton.rb
@@ -1,7 +1,9 @@
+# frozen_string_literal: true
+
class Components
# If an entity can be rendered on screen
class DebugSingleton
- class <<self
+ class << self
@data = false
attr_accessor :data