felflame 1.0.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -2
  3. data/.ruby-version +1 -0
  4. data/CHANGELOG.mdown +60 -5
  5. data/Gemfile +2 -3
  6. data/Gemfile.lock +4 -4
  7. data/README.mdown +127 -74
  8. data/Rakefile +30 -10
  9. data/bin/console +3 -3
  10. data/docs/FelFlame/ComponentManager.html +131 -519
  11. data/docs/FelFlame/Components.html +29 -119
  12. data/docs/FelFlame/Entities.html +125 -387
  13. data/docs/FelFlame/Order.html +251 -0
  14. data/docs/FelFlame/Scenes.html +72 -68
  15. data/docs/FelFlame/Stage.html +30 -56
  16. data/docs/FelFlame/Systems.html +208 -244
  17. data/docs/FelFlame.html +34 -32
  18. data/docs/Felflame_.html +143 -0
  19. data/docs/_index.html +24 -4
  20. data/docs/class_list.html +1 -1
  21. data/docs/file.README.html +145 -83
  22. data/docs/file.version.html +74 -0
  23. data/docs/index.html +145 -83
  24. data/docs/method_list.html +52 -108
  25. data/docs/top-level-namespace.html +5 -5
  26. data/felflame.gemspec +22 -22
  27. data/lib/felflame/component_manager.rb +99 -71
  28. data/lib/felflame/entity_manager.rb +84 -59
  29. data/lib/felflame/order.rb +24 -0
  30. data/lib/felflame/scene_manager.rb +23 -12
  31. data/lib/felflame/stage_manager.rb +10 -33
  32. data/lib/felflame/system_manager.rb +92 -47
  33. data/lib/felflame/version.rb +5 -1
  34. data/lib/felflame.rb +23 -15
  35. metadata +34 -53
  36. data/.yardopts +0 -13
  37. data/codeclimate/env.rb +0 -1
  38. data/codeclimate/export-coverage.rb +0 -16
  39. data/codeclimate/test-reporter-latest-linux-amd64 +0 -0
  40. data/deprecated/components/00_renderable.rb +0 -19
  41. data/deprecated/components/01_sprite.rb +0 -57
  42. data/deprecated/components/02_label.rb +0 -32
  43. data/deprecated/components/03_player_control.rb +0 -26
  44. data/deprecated/components/04_map.rb +0 -21
  45. data/deprecated/components/05_interactable.rb +0 -16
  46. data/deprecated/components/06_collidable.rb +0 -22
  47. data/deprecated/components/07_battle.rb +0 -4
  48. data/deprecated/components/07_indoor.rb +0 -4
  49. data/deprecated/components/07_overworld.rb +0 -16
  50. data/deprecated/components/debug_singleton.rb +0 -13
  51. data/deprecated/helpers/00_tileset.rb +0 -56
  52. data/deprecated/helpers/01_component.rb +0 -74
  53. data/deprecated/systems/00_update_levels.rb +0 -34
  54. data/deprecated/systems/10_player.rb +0 -41
  55. data/deprecated/systems/99_render.rb +0 -37
  56. data/logos/felflame-logo-text.png +0 -0
  57. data/logos/felflame-logo-text.svg +0 -172
  58. data/logos/felflame-logo.png +0 -0
  59. data/logos/felflame-logo.svg +0 -97
@@ -1,10 +1,11 @@
1
- class FelFlame
1
+ # frozen_string_literal: true
2
+
3
+ module FelFlame
2
4
  class Systems
3
5
  # How early this System should be executed in a list of Systems
4
6
  attr_accessor :priority
5
7
 
6
8
  # The Constant name assigned to this System
7
- attr_reader :const_name
8
9
 
9
10
  # Allows overwriting the storage of triggers, such as for clearing.
10
11
  # This method should generally only need to be used internally and
@@ -12,10 +13,20 @@ class FelFlame
12
13
  # @!visibility private
13
14
  attr_writer :addition_triggers, :removal_triggers, :attr_triggers
14
15
 
16
+ # Stores all the scenes this system is a part of.
17
+ attr_writer :scenes
18
+
19
+ def scenes
20
+ @scenes ||= []
21
+ end
22
+
15
23
  def priority=(priority)
16
24
  @priority = priority
17
- FelFlame::Stage.systems.sort_by!(&:priority)
25
+ scenes.each do |scene|
26
+ scene.systems = scene.systems.sort_by(&:priority)
27
+ end
18
28
  end
29
+
19
30
  # Stores references to components or their managers that trigger
20
31
  # this component when a component or component from that manager
21
32
  # is added to an entity.
@@ -34,7 +45,6 @@ class FelFlame
34
45
  @removal_triggers ||= []
35
46
  end
36
47
 
37
-
38
48
  # Stores references to systems that should be triggered when an
39
49
  # attribute from this manager is changed
40
50
  # Do not edit this hash as it is managed by FelFlame automatically.
@@ -43,13 +53,47 @@ class FelFlame
43
53
  @attr_triggers ||= {}
44
54
  end
45
55
 
46
- class <<self
47
- include Enumerable
56
+ class << self
57
+ # Stores the systems in {FelFlame::Components}. This
58
+ # is needed because calling `FelFlame::Components.constants`
59
+ # will not let you iterate over the value of the constants
60
+ # but will instead give you an array of symbols. This caches
61
+ # the convertion of those symbols to the actual value of the
62
+ # constants
63
+ def const_cache
64
+ @const_cache || update_const_cache
65
+ end
48
66
 
49
- # Iterate over all Systems, sorted by their priority. You also call other enumerable methods instead of each, such as +each_with_index+ or +select+
50
- # @return [Enumerator]
51
- def each(&block)
52
- constants.map { |sym| const_get(sym) }.sort_by(&:priority).reverse.each(&block)
67
+ # Updates the array that stores the constants.
68
+ # Used internally by FelFlame
69
+ # @!visibility private
70
+ def update_const_cache
71
+ @const_cache = constants.map do |constant|
72
+ const_get constant
73
+ end
74
+ end
75
+
76
+ # Forwards undefined methods to the array of constants
77
+ # if the array can handle the request. Otherwise tells
78
+ # the programmer their code errored
79
+ # @!visibility private
80
+ def respond_to_missing?(method, *)
81
+ if const_cache.respond_to? method
82
+ true
83
+ else
84
+ super
85
+ end
86
+ end
87
+
88
+ # Makes system module behave like arrays with additional
89
+ # methods for managing the array
90
+ # @!visibility private
91
+ def method_missing(method, *args, **kwargs, &block)
92
+ if const_cache.respond_to? method
93
+ const_cache.send(method, *args, **kwargs, &block)
94
+ else
95
+ super
96
+ end
53
97
  end
54
98
  end
55
99
 
@@ -70,15 +114,17 @@ class FelFlame
70
114
  # @param block [Proc] The code you wish to be executed when the system is triggered. Can be defined by using a +do end+ block or using +{ }+ braces.
71
115
  def initialize(name, priority: 0, &block)
72
116
  FelFlame::Systems.const_set(name, self)
73
- @const_name = name
117
+ FelFlame::Systems.update_const_cache
74
118
  @priority = priority
75
119
  @block = block
120
+ @scenes = []
76
121
  end
77
122
 
78
123
  # Manually execute the system a single time
79
124
  def call
80
125
  @block.call
81
126
  end
127
+
82
128
  # Redefine what code is executed by this System when it is called upon.
83
129
  # @param block [Proc] The code you wish to be executed when the system is triggered. Can be defined by using a +do end+ block or using +{ }+ braces.
84
130
  def redefine(&block)
@@ -109,16 +155,16 @@ class FelFlame
109
155
  # @param component_or_manager [Component or ComponentManager] The object to clear triggers from. Use Nil to clear triggers from all components associated with this system.
110
156
  # @return [Boolean] +true+
111
157
  def clear_triggers(*trigger_types, component_or_manager: nil)
112
- trigger_types = [:addition_triggers, :removal_triggers, :attr_triggers] if trigger_types.empty?
158
+ trigger_types = %i[addition_triggers removal_triggers attr_triggers] if trigger_types.empty?
113
159
 
114
160
  if trigger_types.include? :attr_triggers
115
- if (trigger_types - [:addition_triggers,
116
- :removal_triggers,
117
- :attr_triggers]).empty?
161
+ if (trigger_types - %i[addition_triggers
162
+ removal_triggers
163
+ attr_triggers]).empty?
118
164
 
119
165
  if component_or_manager.nil?
120
- #remove all attrs
121
- self.attr_triggers.each do |cmp_or_mgr, attrs|
166
+ # remove all attrs
167
+ attr_triggers.each do |cmp_or_mgr, attrs|
122
168
  attrs.each do |attr|
123
169
  next if cmp_or_mgr.attr_triggers[attr].nil?
124
170
 
@@ -127,49 +173,48 @@ class FelFlame
127
173
  self.attr_triggers = {}
128
174
  end
129
175
  else
130
- #remove attrs relevant to comp_or_man
131
- unless self.attr_triggers[component_or_manager].nil?
132
- self.attr_triggers[component_or_manager].each do |attr|
176
+ # remove attrs relevant to comp_or_man
177
+ unless attr_triggers[component_or_manager].nil?
178
+ attr_triggers[component_or_manager].each do |attr|
133
179
  component_or_manager.attr_triggers[attr].delete self
134
180
  end
135
- self.attr_triggers[component_or_manager] = []
181
+ attr_triggers[component_or_manager] = []
136
182
  end
137
183
  end
138
184
 
139
- else
185
+ elsif component_or_manager.nil?
140
186
 
141
- if component_or_manager.nil?
142
- (trigger_types - [:addition_triggers, :removal_triggers, :attr_triggers]).each do |attr|
143
- #remove attr
144
- self.attr_triggers.each do |cmp_or_mgr, attrs|
145
- cmp_or_mgr.attr_triggers[attr].delete self
146
- end
147
- end
148
- self.attr_triggers.delete (trigger_types - [:addition_triggers,
149
- :removal_triggers,
150
- :attr_triggers])
151
- else
152
- #remove attr from component_or_manager
153
- (trigger_types - [:addition_triggers, :removal_triggers, :attr_triggers]).each do |attr|
154
- next if component_or_manager.attr_triggers[attr].nil?
155
- component_or_manager.attr_triggers[attr].delete self
187
+ (trigger_types - %i[addition_triggers removal_triggers attr_triggers]).each do |attr|
188
+ # remove attr
189
+ attr_triggers.each do |cmp_or_mgr, _attrs|
190
+ cmp_or_mgr.attr_triggers[attr].delete self
156
191
  end
157
- self.attr_triggers[component_or_manager] -= trigger_types unless self.attr_triggers[component_or_manager].nil?
158
192
  end
193
+ attr_triggers.delete(trigger_types - %i[addition_triggers
194
+ removal_triggers
195
+ attr_triggers])
196
+ else
197
+ # remove attr from component_or_manager
198
+ (trigger_types - %i[addition_triggers removal_triggers attr_triggers]).each do |attr|
199
+ next if component_or_manager.attr_triggers[attr].nil?
200
+
201
+ component_or_manager.attr_triggers[attr].delete self
202
+ end
203
+ attr_triggers[component_or_manager] -= trigger_types unless attr_triggers[component_or_manager].nil?
159
204
 
160
205
  end
161
206
  end
162
207
 
163
- (trigger_types & [:removal_triggers, :addition_triggers] - [:attr_triggers]).each do |trigger_type|
208
+ (trigger_types & %i[removal_triggers addition_triggers] - [:attr_triggers]).each do |trigger_type|
164
209
  if component_or_manager.nil?
165
- #remove all removal triggers
166
- self.send(trigger_type).each do |trigger|
210
+ # remove all removal triggers
211
+ send(trigger_type).each do |trigger|
167
212
  trigger.send(trigger_type).delete self
168
213
  end
169
- self.send("#{trigger_type.to_s}=", [])
214
+ send("#{trigger_type}=", [])
170
215
  else
171
- #remove removal trigger relevant to comp/man
172
- self.send(trigger_type).delete component_or_manager
216
+ # remove removal trigger relevant to comp/man
217
+ send(trigger_type).delete component_or_manager
173
218
  component_or_manager.send(trigger_type).delete self
174
219
  end
175
220
  end
@@ -202,10 +247,10 @@ class FelFlame
202
247
  else
203
248
  component_or_manager.attr_triggers[attr] |= [self]
204
249
  end
205
- if self.attr_triggers[component_or_manager].nil?
206
- self.attr_triggers[component_or_manager] = [attr]
250
+ if attr_triggers[component_or_manager].nil?
251
+ attr_triggers[component_or_manager] = [attr]
207
252
  else
208
- self.attr_triggers[component_or_manager] |= [attr]
253
+ attr_triggers[component_or_manager] |= [attr]
209
254
  end
210
255
  true
211
256
  end
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # :nocov:
4
+ # Keeps the version of the Gem
3
5
  module Felflame
4
- VERSION = "1.0.1"
6
+ # The version of the Gem
7
+ VERSION = '4.0.0'
5
8
  end
9
+ # :nocov:
data/lib/felflame.rb CHANGED
@@ -1,14 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'felflame/entity_manager'
2
4
  require_relative 'felflame/component_manager'
3
5
  require_relative 'felflame/system_manager'
4
6
  require_relative 'felflame/scene_manager'
5
7
  require_relative 'felflame/stage_manager'
8
+ require_relative 'felflame/order'
6
9
 
7
- require_relative "felflame/version"
10
+ require_relative 'felflame/version'
8
11
 
9
12
  # The FelFlame namespace where all its functionality resides under.
10
- class FelFlame
11
- class <<self
13
+ module FelFlame
14
+ class << self
12
15
  # :nocov:
13
16
 
14
17
  # An alias for {FelFlame::Stage.call}. It executes a single frame in the game.
@@ -18,26 +21,28 @@ class FelFlame
18
21
  # :nocov:
19
22
  end
20
23
 
21
- # Creates and manages Entities. Allows accessing Entities using their {FelFlame::Entities#id ID}. Entities are just collections of Components.
24
+ # Creates and manages Entities. Entities are just collections of Components.
25
+ # You can use array methods directly on this class to access Entities.
22
26
  class Entities; end
23
27
 
24
- # Creates component managers and allows accessing them them under the {FelFlame::Components} namespace as Constants
28
+ # Creates component managers and allows accessing them them under the {FelFlame::Components} namespace as Constants.
29
+ # You can use array methods directly on this class to access Component Managers.
25
30
  #
26
31
  # To see how component managers are used please look at the {FelFlame::ComponentManager} documentation.
27
- class Components; end
32
+ module Components; end
28
33
 
29
- # Creates an manages Systems. Systems are the logic of the game and do not contain any data within them.
30
- #
31
- # TODO: Improve Systems overview
34
+ # Creates and manages Systems. Systems are the logic of the game and do not contain any data within them. Any systems you create are accessable under the {FelFlame::Systems} namespace as Constants.
35
+ # You can use array methods directly on this class to access Systems.
32
36
  class Systems; end
33
37
 
34
- # Creates and manages Scenes. Scenes are collections of Systems, and execute all the Systems when called upon.
35
- #
36
- # TODO: Improve Scenes overview
38
+ # Creates and manages Scenes. Scenes are collections of Systems, and execute all the Systems when called upon. Any scenes you create are accessable under the {FelFlame::Scenes} namespace as Constants.
37
39
  class Scenes; end
38
40
 
39
- # Stores Scenes which you want to execute on each frame. When called upon will execute all Systems in the Scenes in the Stage and will execute them according to their priority order.
40
- class Stage; end
41
+ # Stores Scenes you add to it which you want to execute on each frame. When called upon will execute all Systems in the Scenes in the Stage and will execute them according to their priority order.
42
+ module Stage; end
43
+
44
+ # Sets the priority of a list of Systems or Scenes for you in the order you pass them to this class.
45
+ module Order; end
41
46
  end
42
47
 
43
48
  # An alias for {FelFlame}
@@ -53,7 +58,10 @@ FF::Cmp = FelFlame::Components
53
58
  FF::Sys = FelFlame::Systems
54
59
 
55
60
  # An alias for {FelFlame::Scenes}
56
- FF::Sce = FelFlame::Scenes
61
+ FF::Scn = FelFlame::Scenes
57
62
 
58
63
  # An alias for {FelFlame::Stage}
59
64
  FF::Stg = FelFlame::Stage
65
+
66
+ # An alias for {FelFlame::
67
+ FF::Odr = FelFlame::Order
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: felflame
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tradam
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-09 00:00:00.000000000 Z
11
+ date: 2022-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest-reporters
@@ -31,109 +31,109 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.4.3
33
33
  - !ruby/object:Gem::Dependency
34
- name: rspec
34
+ name: redcarpet
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '3.10'
39
+ version: '3.5'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.5.1
40
43
  type: :development
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
47
  - - "~>"
45
48
  - !ruby/object:Gem::Version
46
- version: '3.10'
49
+ version: '3.5'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.5.1
47
53
  - !ruby/object:Gem::Dependency
48
- name: simplecov
54
+ name: rspec
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
51
57
  - - "~>"
52
58
  - !ruby/object:Gem::Version
53
- version: 0.21.2
59
+ version: '3.10'
54
60
  type: :development
55
61
  prerelease: false
56
62
  version_requirements: !ruby/object:Gem::Requirement
57
63
  requirements:
58
64
  - - "~>"
59
65
  - !ruby/object:Gem::Version
60
- version: 0.21.2
66
+ version: '3.10'
61
67
  - !ruby/object:Gem::Dependency
62
- name: simplecov-console
68
+ name: rubocop
63
69
  requirement: !ruby/object:Gem::Requirement
64
70
  requirements:
65
71
  - - "~>"
66
72
  - !ruby/object:Gem::Version
67
- version: 0.9.1
73
+ version: '1.7'
68
74
  type: :development
69
75
  prerelease: false
70
76
  version_requirements: !ruby/object:Gem::Requirement
71
77
  requirements:
72
78
  - - "~>"
73
79
  - !ruby/object:Gem::Version
74
- version: 0.9.1
80
+ version: '1.7'
75
81
  - !ruby/object:Gem::Dependency
76
- name: simplecov_json_formatter
82
+ name: simplecov
77
83
  requirement: !ruby/object:Gem::Requirement
78
84
  requirements:
79
85
  - - "~>"
80
86
  - !ruby/object:Gem::Version
81
- version: 0.1.3
87
+ version: 0.21.2
82
88
  type: :development
83
89
  prerelease: false
84
90
  version_requirements: !ruby/object:Gem::Requirement
85
91
  requirements:
86
92
  - - "~>"
87
93
  - !ruby/object:Gem::Version
88
- version: 0.1.3
94
+ version: 0.21.2
89
95
  - !ruby/object:Gem::Dependency
90
- name: redcarpet
96
+ name: simplecov-console
91
97
  requirement: !ruby/object:Gem::Requirement
92
98
  requirements:
93
99
  - - "~>"
94
100
  - !ruby/object:Gem::Version
95
- version: '3.5'
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: 3.5.1
101
+ version: 0.9.1
99
102
  type: :development
100
103
  prerelease: false
101
104
  version_requirements: !ruby/object:Gem::Requirement
102
105
  requirements:
103
106
  - - "~>"
104
107
  - !ruby/object:Gem::Version
105
- version: '3.5'
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: 3.5.1
108
+ version: 0.9.1
109
109
  - !ruby/object:Gem::Dependency
110
- name: yard
110
+ name: simplecov_json_formatter
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: 0.9.26
115
+ version: 0.1.3
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: 0.9.26
122
+ version: 0.1.3
123
123
  - !ruby/object:Gem::Dependency
124
- name: rubocop
124
+ name: yard
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '1.7'
129
+ version: 0.9.26
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: '1.7'
136
+ version: 0.9.26
137
137
  description:
138
138
  email:
139
139
  - felflame@tradam.dev
@@ -146,7 +146,7 @@ files:
146
146
  - ".inch.yml"
147
147
  - ".rspec"
148
148
  - ".rubocop.yml"
149
- - ".yardopts"
149
+ - ".ruby-version"
150
150
  - CHANGELOG.mdown
151
151
  - Gemfile
152
152
  - Gemfile.lock
@@ -155,25 +155,6 @@ files:
155
155
  - Rakefile
156
156
  - bin/console
157
157
  - bin/setup
158
- - codeclimate/env.rb
159
- - codeclimate/export-coverage.rb
160
- - codeclimate/test-reporter-latest-linux-amd64
161
- - deprecated/components/00_renderable.rb
162
- - deprecated/components/01_sprite.rb
163
- - deprecated/components/02_label.rb
164
- - deprecated/components/03_player_control.rb
165
- - deprecated/components/04_map.rb
166
- - deprecated/components/05_interactable.rb
167
- - deprecated/components/06_collidable.rb
168
- - deprecated/components/07_battle.rb
169
- - deprecated/components/07_indoor.rb
170
- - deprecated/components/07_overworld.rb
171
- - deprecated/components/debug_singleton.rb
172
- - deprecated/helpers/00_tileset.rb
173
- - deprecated/helpers/01_component.rb
174
- - deprecated/systems/00_update_levels.rb
175
- - deprecated/systems/10_player.rb
176
- - deprecated/systems/99_render.rb
177
158
  - docs/CNAME
178
159
  - docs/FelFlame.html
179
160
  - docs/FelFlame/ComponentManager.html
@@ -181,15 +162,18 @@ files:
181
162
  - docs/FelFlame/Entities.html
182
163
  - docs/FelFlame/Helper.html
183
164
  - docs/FelFlame/Helper/ComponentManager.html
165
+ - docs/FelFlame/Order.html
184
166
  - docs/FelFlame/Scenes.html
185
167
  - docs/FelFlame/Stage.html
186
168
  - docs/FelFlame/Systems.html
169
+ - docs/Felflame_.html
187
170
  - docs/_index.html
188
171
  - docs/class_list.html
189
172
  - docs/css/common.css
190
173
  - docs/css/full_list.css
191
174
  - docs/css/style.css
192
175
  - docs/file.README.html
176
+ - docs/file.version.html
193
177
  - docs/file_list.html
194
178
  - docs/frames.html
195
179
  - docs/index.html
@@ -202,14 +186,11 @@ files:
202
186
  - lib/felflame.rb
203
187
  - lib/felflame/component_manager.rb
204
188
  - lib/felflame/entity_manager.rb
189
+ - lib/felflame/order.rb
205
190
  - lib/felflame/scene_manager.rb
206
191
  - lib/felflame/stage_manager.rb
207
192
  - lib/felflame/system_manager.rb
208
193
  - lib/felflame/version.rb
209
- - logos/felflame-logo-text.png
210
- - logos/felflame-logo-text.svg
211
- - logos/felflame-logo.png
212
- - logos/felflame-logo.svg
213
194
  homepage: https://felflame.tradam.fyi
214
195
  licenses:
215
196
  - MIT
data/.yardopts DELETED
@@ -1,13 +0,0 @@
1
- --readme README.mdown
2
- --markup=markdown|textile|rdoc(default)
3
- --protected
4
- --no-private
5
-
6
- LICENSE
7
- README.mdown
8
- system_manager.rb
9
- component_manager.rb
10
- entity_manager.rb
11
- scene_manager.rb
12
- stage_manager.rb
13
- felflame.rb
data/codeclimate/env.rb DELETED
@@ -1 +0,0 @@
1
- ENV['CC_TEST_REPORTER_ID'] = '48d1c389052ea205cb4d72b05f7606fc53a9b5def70c2bfdd957efb73657d32c'
@@ -1,16 +0,0 @@
1
- require_relative 'env'
2
-
3
-
4
- class ReportCoverage
5
- class <<self
6
- def format
7
- puts
8
- puts 'Formatting Coverage...'
9
- puts `./codeclimate/test-reporter-latest-linux-amd64 format-coverage -t simplecov`
10
- end
11
-
12
- def upload
13
- puts `./codeclimate/test-reporter-latest-linux-amd64 upload-coverage --id #{ENV['CC_TEST_REPORTER_ID']}`
14
- end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- FelFlame::Components.new('Renderable', z: 0)
2
- =begin
3
- class Components
4
- # If an entity can be rendered on screen
5
- class Renderable < Helper::BaseComponent
6
- attr_accessor :z
7
-
8
- def initialize
9
- @z = 0
10
- end
11
-
12
- def set(**opts)
13
- opts.each do |key, value|
14
- self.send "#{key}=", value
15
- end
16
- end
17
- end
18
- end
19
- =end
@@ -1,57 +0,0 @@
1
-
2
- FelFlame::Components.new('Sprite', :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b,
3
- :source_x, :source_y, :source_w, :source_h,
4
- :tile_x, :tile_y, :tile_w, :tile_h,
5
- :flip_horizontally, :flip_vertically,
6
- :angle_anchor_x, :angle_anchor_y, primative_marker: :sprite)
7
-
8
- #Components::Sprite.define_method('primative_marker') do
9
- # :sprite
10
- #end
11
-
12
- =begin
13
- class Components
14
- # If an entity can be rendered on screen
15
- class Sprite < Helper::BaseComponent
16
-
17
- attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b,
18
- :source_x, :source_y, :source_w, :source_h,
19
- :tile_x, :tile_y, :tile_w, :tile_h,
20
- :flip_horizontally, :flip_vertically,
21
- :angle_anchor_x, :angle_anchor_y
22
-
23
- def set(x: @x, y: @y, w: @w, h: @h, path: @path, angle: @angle, a: @a, r: @r, g: @g, b: @b,
24
- source_x: @source_x, source_y: @source_y, source_w: @source_w, source_h: @source_h,
25
- tile_x: @tile_x, tile_y: @tile_y, tile_w: @tile_w, tile_h: @tile_h,
26
- flip_horizontally: @flip_horizontally, flip_vertically: @flip_vertically,
27
- angle_anchor_x: @angle_anchor_x, angle_anchor_y: @angle_anchor_y)
28
- {x: @x = x,
29
- y: @y = y,
30
- w: @w = w,
31
- h: @h = h,
32
- path: @path = path,
33
- angle: @angle = angle,
34
- a: @a = a,
35
- r: @r = r,
36
- g: @g = g,
37
- b: @b = b,
38
- source_x: @source_x = source_x,
39
- source_y: @source_y = source_y,
40
- source_w: @source_w = source_w,
41
- source_h: @source_h = source_h,
42
- tile_x: @tile_x = tile_x,
43
- tile_y: @tile_y = tile_y,
44
- tile_w: @tile_w = tile_w,
45
- tile_h: @tile_h = tile_h,
46
- flip_horizontally: @flip_horizontally = flip_horizontally,
47
- flip_vertically: @flip_vertically = flip_vertically,
48
- angle_anchor_x: @angle_anchor_x = angle_anchor_x,
49
- angle_anchor_y: @angle_anchor_y = angle_anchor_y}
50
- end
51
-
52
- def primative_marker
53
- :sprite
54
- end
55
- end
56
- end
57
- =end
@@ -1,32 +0,0 @@
1
-
2
- FelFlame::Components.new :Label, :x, :y, :text, :size_enum, :alignment_enum,
3
- :a, :r, :g, :b, :font, :vertical_alignment_enum, primative_marker: :label
4
- =begin
5
- class Components
6
- # A dragonruby label wrapper
7
- class Label < Helper::BaseComponent
8
-
9
- attr_accessor :x, :y, :text, :size_enum, :alignment_enum,
10
- :a, :r, :g, :b, :font, :vertical_alignment_enum
11
-
12
- def set(x: @x, y: @y, text: @text, size_enum: @size_enum, alignment_enum: @alignment_enum,
13
- a: @a, r: @r, g: @g, b: @b, font: @font, vertical_alignment_enum: @vertical_alignment_enum)
14
- {x: @x = x,
15
- y: @y = y,
16
- text: @text = text,
17
- size_enum: @size_enum = size_enum,
18
- alignment_enum: @alignment_enum = alignment_enum,
19
- r: @r = r,
20
- g: @g = g,
21
- b: @b = b,
22
- a: @a = a,
23
- font: @font = font,
24
- vertical_alignment_enum: @vertical_alignment_enum = vertical_alignment_enum }
25
- end
26
-
27
- def primative_marker
28
- :label
29
- end
30
- end
31
- end
32
- end