fantasy 0.1.11 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +22 -1
  3. data/.yardopts +4 -0
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +55 -0
  7. data/README.md +36 -13
  8. data/docs/Actor.html +2737 -0
  9. data/docs/Background.html +961 -0
  10. data/docs/Camera.html +791 -0
  11. data/docs/Clock.html +753 -0
  12. data/docs/Color.html +776 -0
  13. data/docs/Coordinates.html +730 -0
  14. data/docs/Cursor.html +752 -0
  15. data/docs/Disk.html +236 -0
  16. data/docs/Draggable.html +198 -0
  17. data/docs/Fantasy.html +121 -0
  18. data/docs/Game.html +904 -0
  19. data/docs/Global.html +2791 -0
  20. data/docs/Gravitier.html +179 -0
  21. data/docs/HudImage.html +979 -0
  22. data/docs/HudText.html +1151 -0
  23. data/docs/Image.html +506 -0
  24. data/docs/Jumper.html +189 -0
  25. data/docs/Mouse.html +226 -0
  26. data/docs/MoveByCursor.html +374 -0
  27. data/docs/MoveByDirection.html +179 -0
  28. data/docs/Mover.html +305 -0
  29. data/docs/Music.html +524 -0
  30. data/docs/Shape.html +1057 -0
  31. data/docs/Sound.html +374 -0
  32. data/docs/Tilemap.html +491 -0
  33. data/docs/Tween.html +186 -0
  34. data/docs/UserInputs.html +879 -0
  35. data/docs/Utils.html +345 -0
  36. data/docs/_index.html +346 -0
  37. data/docs/class_list.html +51 -0
  38. data/docs/css/common.css +1 -0
  39. data/docs/css/full_list.css +58 -0
  40. data/docs/css/style.css +497 -0
  41. data/docs/file.CHANGELOG.html +121 -0
  42. data/docs/file.README.html +599 -0
  43. data/docs/file_list.html +61 -0
  44. data/docs/frames.html +17 -0
  45. data/docs/index.html +599 -0
  46. data/docs/js/app.js +314 -0
  47. data/docs/js/full_list.js +216 -0
  48. data/docs/js/jquery.js +4 -0
  49. data/docs/method_list.html +1931 -0
  50. data/docs/top-level-namespace.html +978 -0
  51. data/lib/fantasy/actor.rb +455 -112
  52. data/lib/fantasy/background.rb +109 -13
  53. data/lib/fantasy/base.rb +113 -1
  54. data/lib/fantasy/camera.rb +95 -11
  55. data/lib/fantasy/clock.rb +4 -2
  56. data/lib/fantasy/color.rb +158 -153
  57. data/lib/fantasy/coordinates.rb +5 -9
  58. data/lib/fantasy/cursor.rb +22 -0
  59. data/lib/fantasy/disk.rb +35 -0
  60. data/lib/fantasy/draggable.rb +22 -1
  61. data/lib/fantasy/global.rb +59 -31
  62. data/lib/fantasy/hud_image.rb +5 -3
  63. data/lib/fantasy/hud_text.rb +9 -3
  64. data/lib/fantasy/image.rb +12 -4
  65. data/lib/fantasy/includes/gravitier.rb +2 -0
  66. data/lib/fantasy/includes/jumper.rb +3 -2
  67. data/lib/fantasy/includes/log.rb +12 -0
  68. data/lib/fantasy/includes/move_by_cursors.rb +24 -15
  69. data/lib/fantasy/includes/move_by_direction.rb +2 -0
  70. data/lib/fantasy/includes/mover.rb +7 -0
  71. data/lib/fantasy/includes/user_inputs.rb +6 -0
  72. data/lib/fantasy/loop.rb +41 -44
  73. data/lib/fantasy/mouse.rb +2 -0
  74. data/lib/fantasy/music.rb +7 -3
  75. data/lib/fantasy/shape.rb +11 -2
  76. data/lib/fantasy/sound.rb +5 -3
  77. data/lib/fantasy/tilemap.rb +19 -13
  78. data/lib/fantasy/tween.rb +3 -1
  79. data/lib/fantasy/utils.rb +7 -13
  80. data/lib/fantasy/version.rb +1 -1
  81. data/lib/fantasy.rb +3 -0
  82. metadata +91 -4
  83. data/fantasy.gemspec +0 -40
  84. data/fonts/VT323-Regular.ttf +0 -0
@@ -0,0 +1,179 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: MoveByDirection
8
+
9
+ &mdash; Documentation by YARD 0.9.27
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "MoveByDirection";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (M)</a> &raquo;
40
+
41
+
42
+ <span class="title">MoveByDirection</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: MoveByDirection
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dl>
78
+ <dt>Included in:</dt>
79
+ <dd><span class='object_link'><a href="Actor.html" title="Actor (class)">Actor</a></span></dd>
80
+ </dl>
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/fantasy/includes/move_by_direction.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <h2>
100
+ Instance Method Summary
101
+ <small><a href="#" class="summary_toggle">collapse</a></small>
102
+ </h2>
103
+
104
+ <ul class="summary">
105
+
106
+ <li class="public ">
107
+ <span class="summary_signature">
108
+
109
+ <a href="#move_by_direction-instance_method" title="#move_by_direction (instance method)">#<strong>move_by_direction</strong> &#x21d2; Object </a>
110
+
111
+
112
+
113
+ </span>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <span class="summary_desc"><div class='inline'></div></span>
124
+
125
+ </li>
126
+
127
+
128
+ </ul>
129
+
130
+
131
+
132
+
133
+ <div id="instance_method_details" class="method_details_list">
134
+ <h2>Instance Method Details</h2>
135
+
136
+
137
+ <div class="method_details first">
138
+ <h3 class="signature first" id="move_by_direction-instance_method">
139
+
140
+ #<strong>move_by_direction</strong> &#x21d2; <tt>Object</tt>
141
+
142
+
143
+
144
+
145
+
146
+ </h3><table class="source_code">
147
+ <tr>
148
+ <td>
149
+ <pre class="lines">
150
+
151
+
152
+ 4
153
+ 5
154
+ 6</pre>
155
+ </td>
156
+ <td>
157
+ <pre class="code"><span class="info file"># File 'lib/fantasy/includes/move_by_direction.rb', line 4</span>
158
+
159
+ <span class='kw'>def</span> <span class='id identifier rubyid_move_by_direction'>move_by_direction</span>
160
+ <span class='ivar'>@position</span> <span class='op'>+=</span> <span class='ivar'>@direction</span> <span class='op'>*</span> <span class='ivar'>@speed</span> <span class='op'>*</span> <span class='const'><span class='object_link'><a href="Global.html" title="Global (module)">Global</a></span></span><span class='period'>.</span><span class='id identifier rubyid_frame_time'><span class='object_link'><a href="Global.html#frame_time-class_method" title="Global.frame_time (method)">frame_time</a></span></span>
161
+ <span class='kw'>end</span></pre>
162
+ </td>
163
+ </tr>
164
+ </table>
165
+ </div>
166
+
167
+ </div>
168
+
169
+ </div>
170
+
171
+ <div id="footer">
172
+ Generated on Sat Apr 2 14:24:12 2022 by
173
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
174
+ 0.9.27 (ruby-3.0.2).
175
+ </div>
176
+
177
+ </div>
178
+ </body>
179
+ </html>
data/docs/Mover.html ADDED
@@ -0,0 +1,305 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Mover
8
+
9
+ &mdash; Documentation by YARD 0.9.27
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Mover";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (M)</a> &raquo;
40
+
41
+
42
+ <span class="title">Mover</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: Mover
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dl>
78
+ <dt>Included in:</dt>
79
+ <dd><span class='object_link'><a href="Actor.html" title="Actor (class)">Actor</a></span></dd>
80
+ </dl>
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/fantasy/includes/mover.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <h2>
100
+ Instance Method Summary
101
+ <small><a href="#" class="summary_toggle">collapse</a></small>
102
+ </h2>
103
+
104
+ <ul class="summary">
105
+
106
+ <li class="public ">
107
+ <span class="summary_signature">
108
+
109
+ <a href="#add_force-instance_method" title="#add_force (instance method)">#<strong>add_force</strong>(force) &#x21d2; Object </a>
110
+
111
+
112
+
113
+ </span>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <span class="summary_desc"><div class='inline'></div></span>
124
+
125
+ </li>
126
+
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#apply_forces-instance_method" title="#apply_forces (instance method)">#<strong>apply_forces</strong>(max_speed: Float::INFINITY) &#x21d2; Object </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <span class="summary_desc"><div class='inline'></div></span>
146
+
147
+ </li>
148
+
149
+
150
+ <li class="public ">
151
+ <span class="summary_signature">
152
+
153
+ <a href="#impulse-instance_method" title="#impulse (instance method)">#<strong>impulse</strong>(direction:, force:) &#x21d2; Object </a>
154
+
155
+
156
+
157
+ </span>
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'></div></span>
168
+
169
+ </li>
170
+
171
+
172
+ </ul>
173
+
174
+
175
+
176
+
177
+ <div id="instance_method_details" class="method_details_list">
178
+ <h2>Instance Method Details</h2>
179
+
180
+
181
+ <div class="method_details first">
182
+ <h3 class="signature first" id="add_force-instance_method">
183
+
184
+ #<strong>add_force</strong>(force) &#x21d2; <tt>Object</tt>
185
+
186
+
187
+
188
+
189
+
190
+ </h3><table class="source_code">
191
+ <tr>
192
+ <td>
193
+ <pre class="lines">
194
+
195
+
196
+ 8
197
+ 9
198
+ 10
199
+ 11</pre>
200
+ </td>
201
+ <td>
202
+ <pre class="code"><span class="info file"># File 'lib/fantasy/includes/mover.rb', line 8</span>
203
+
204
+ <span class='kw'>def</span> <span class='id identifier rubyid_add_force'>add_force</span><span class='lparen'>(</span><span class='id identifier rubyid_force'>force</span><span class='rparen'>)</span>
205
+ <span class='ivar'>@acceleration</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Coordinates.html" title="Coordinates (class)">Coordinates</a></span></span><span class='period'>.</span><span class='id identifier rubyid_zero'><span class='object_link'><a href="Coordinates.html#zero-class_method" title="Coordinates.zero (method)">zero</a></span></span>
206
+ <span class='ivar'>@acceleration</span> <span class='op'>+=</span> <span class='id identifier rubyid_force'>force</span>
207
+ <span class='kw'>end</span></pre>
208
+ </td>
209
+ </tr>
210
+ </table>
211
+ </div>
212
+
213
+ <div class="method_details ">
214
+ <h3 class="signature " id="apply_forces-instance_method">
215
+
216
+ #<strong>apply_forces</strong>(max_speed: Float::INFINITY) &#x21d2; <tt>Object</tt>
217
+
218
+
219
+
220
+
221
+
222
+ </h3><table class="source_code">
223
+ <tr>
224
+ <td>
225
+ <pre class="lines">
226
+
227
+
228
+ 13
229
+ 14
230
+ 15
231
+ 16
232
+ 17
233
+ 18
234
+ 19
235
+ 20
236
+ 21
237
+ 22
238
+ 23
239
+ 24
240
+ 25</pre>
241
+ </td>
242
+ <td>
243
+ <pre class="code"><span class="info file"># File 'lib/fantasy/includes/mover.rb', line 13</span>
244
+
245
+ <span class='kw'>def</span> <span class='id identifier rubyid_apply_forces'>apply_forces</span><span class='lparen'>(</span><span class='label'>max_speed:</span> <span class='const'>Float</span><span class='op'>::</span><span class='const'>INFINITY</span><span class='rparen'>)</span>
246
+ <span class='ivar'>@acceleration</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Coordinates.html" title="Coordinates (class)">Coordinates</a></span></span><span class='period'>.</span><span class='id identifier rubyid_zero'><span class='object_link'><a href="Coordinates.html#zero-class_method" title="Coordinates.zero (method)">zero</a></span></span>
247
+ <span class='ivar'>@velocity</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Coordinates.html" title="Coordinates (class)">Coordinates</a></span></span><span class='period'>.</span><span class='id identifier rubyid_zero'><span class='object_link'><a href="Coordinates.html#zero-class_method" title="Coordinates.zero (method)">zero</a></span></span>
248
+
249
+ <span class='ivar'>@velocity</span> <span class='op'>+=</span> <span class='ivar'>@acceleration</span>
250
+ <span class='ivar'>@velocity</span><span class='period'>.</span><span class='id identifier rubyid_resize'>resize</span><span class='lparen'>(</span><span class='id identifier rubyid_max_speed'>max_speed</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@velocity</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_max_speed'>max_speed</span>
251
+
252
+ <span class='kw'>unless</span> <span class='ivar'>@velocity</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
253
+ <span class='ivar'>@position</span> <span class='op'>+=</span> <span class='ivar'>@velocity</span> <span class='op'>*</span> <span class='const'><span class='object_link'><a href="Global.html" title="Global (module)">Global</a></span></span><span class='period'>.</span><span class='id identifier rubyid_frame_time'><span class='object_link'><a href="Global.html#frame_time-class_method" title="Global.frame_time (method)">frame_time</a></span></span>
254
+ <span class='kw'>end</span>
255
+
256
+ <span class='ivar'>@acceleration</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Coordinates.html" title="Coordinates (class)">Coordinates</a></span></span><span class='period'>.</span><span class='id identifier rubyid_zero'><span class='object_link'><a href="Coordinates.html#zero-class_method" title="Coordinates.zero (method)">zero</a></span></span>
257
+ <span class='kw'>end</span></pre>
258
+ </td>
259
+ </tr>
260
+ </table>
261
+ </div>
262
+
263
+ <div class="method_details ">
264
+ <h3 class="signature " id="impulse-instance_method">
265
+
266
+ #<strong>impulse</strong>(direction:, force:) &#x21d2; <tt>Object</tt>
267
+
268
+
269
+
270
+
271
+
272
+ </h3><table class="source_code">
273
+ <tr>
274
+ <td>
275
+ <pre class="lines">
276
+
277
+
278
+ 4
279
+ 5
280
+ 6</pre>
281
+ </td>
282
+ <td>
283
+ <pre class="code"><span class="info file"># File 'lib/fantasy/includes/mover.rb', line 4</span>
284
+
285
+ <span class='kw'>def</span> <span class='id identifier rubyid_impulse'>impulse</span><span class='lparen'>(</span><span class='label'>direction:</span><span class='comma'>,</span> <span class='label'>force:</span><span class='rparen'>)</span>
286
+ <span class='id identifier rubyid_add_force'>add_force</span><span class='lparen'>(</span><span class='id identifier rubyid_direction'>direction</span><span class='period'>.</span><span class='id identifier rubyid_normalize'>normalize</span> <span class='op'>*</span> <span class='id identifier rubyid_force'>force</span><span class='rparen'>)</span>
287
+ <span class='kw'>end</span></pre>
288
+ </td>
289
+ </tr>
290
+ </table>
291
+ </div>
292
+
293
+ </div>
294
+
295
+ </div>
296
+
297
+ <div id="footer">
298
+ Generated on Sat Apr 2 14:24:12 2022 by
299
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
300
+ 0.9.27 (ruby-3.0.2).
301
+ </div>
302
+
303
+ </div>
304
+ </body>
305
+ </html>