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
data/docs/Music.html ADDED
@@ -0,0 +1,524 @@
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: Music
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 = "Music";
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">Music</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: Music
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/fantasy/music.rb</dd>
82
+ </dl>
83
+
84
+ </div>
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+ <h2>
95
+ Class Method Summary
96
+ <small><a href="#" class="summary_toggle">collapse</a></small>
97
+ </h2>
98
+
99
+ <ul class="summary">
100
+
101
+ <li class="public ">
102
+ <span class="summary_signature">
103
+
104
+ <a href="#base_path-class_method" title="base_path (class method)">.<strong>base_path</strong> &#x21d2; Object </a>
105
+
106
+
107
+
108
+ </span>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ <span class="summary_desc"><div class='inline'></div></span>
119
+
120
+ </li>
121
+
122
+
123
+ <li class="public ">
124
+ <span class="summary_signature">
125
+
126
+ <a href="#locate_music-class_method" title="locate_music (class method)">.<strong>locate_music</strong>(music_name) &#x21d2; Object </a>
127
+
128
+
129
+
130
+ </span>
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'></div></span>
141
+
142
+ </li>
143
+
144
+
145
+ <li class="public ">
146
+ <span class="summary_signature">
147
+
148
+ <a href="#play-class_method" title="play (class method)">.<strong>play</strong>(music_name, volume: nil) &#x21d2; Object </a>
149
+
150
+
151
+
152
+ </span>
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <span class="summary_desc"><div class='inline'></div></span>
163
+
164
+ </li>
165
+
166
+
167
+ <li class="public ">
168
+ <span class="summary_signature">
169
+
170
+ <a href="#preload_musics-class_method" title="preload_musics (class method)">.<strong>preload_musics</strong> &#x21d2; Object </a>
171
+
172
+
173
+
174
+ </span>
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ <span class="summary_desc"><div class='inline'></div></span>
185
+
186
+ </li>
187
+
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
192
+ <a href="#stop-class_method" title="stop (class method)">.<strong>stop</strong> &#x21d2; Object </a>
193
+
194
+
195
+
196
+ </span>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'></div></span>
207
+
208
+ </li>
209
+
210
+
211
+ <li class="public ">
212
+ <span class="summary_signature">
213
+
214
+ <a href="#volume-class_method" title="volume (class method)">.<strong>volume</strong> &#x21d2; Object </a>
215
+
216
+
217
+
218
+ </span>
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+ <span class="summary_desc"><div class='inline'></div></span>
229
+
230
+ </li>
231
+
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#volume=-class_method" title="volume= (class method)">.<strong>volume=</strong>(value) &#x21d2; Object </a>
237
+
238
+
239
+
240
+ </span>
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <span class="summary_desc"><div class='inline'></div></span>
251
+
252
+ </li>
253
+
254
+
255
+ </ul>
256
+
257
+
258
+
259
+
260
+ <div id="class_method_details" class="method_details_list">
261
+ <h2>Class Method Details</h2>
262
+
263
+
264
+ <div class="method_details first">
265
+ <h3 class="signature first" id="base_path-class_method">
266
+
267
+ .<strong>base_path</strong> &#x21d2; <tt>Object</tt>
268
+
269
+
270
+
271
+
272
+
273
+ </h3><table class="source_code">
274
+ <tr>
275
+ <td>
276
+ <pre class="lines">
277
+
278
+
279
+ 51
280
+ 52
281
+ 53</pre>
282
+ </td>
283
+ <td>
284
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 51</span>
285
+
286
+ <span class='kw'>def</span> <span class='id identifier rubyid_base_path'>base_path</span>
287
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span><span class='embexpr_end'>}</span><span class='tstring_content'>/musics</span><span class='tstring_end'>&quot;</span></span>
288
+ <span class='kw'>end</span></pre>
289
+ </td>
290
+ </tr>
291
+ </table>
292
+ </div>
293
+
294
+ <div class="method_details ">
295
+ <h3 class="signature " id="locate_music-class_method">
296
+
297
+ .<strong>locate_music</strong>(music_name) &#x21d2; <tt>Object</tt>
298
+
299
+
300
+
301
+
302
+
303
+ </h3><table class="source_code">
304
+ <tr>
305
+ <td>
306
+ <pre class="lines">
307
+
308
+
309
+ 29
310
+ 30
311
+ 31
312
+ 32
313
+ 33
314
+ 34
315
+ 35
316
+ 36
317
+ 37
318
+ 38
319
+ 39
320
+ 40
321
+ 41</pre>
322
+ </td>
323
+ <td>
324
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 29</span>
325
+
326
+ <span class='kw'>def</span> <span class='id identifier rubyid_locate_music'>locate_music</span><span class='lparen'>(</span><span class='id identifier rubyid_music_name'>music_name</span><span class='rparen'>)</span>
327
+ <span class='kw'>return</span> <span class='cvar'>@@musics</span><span class='lbracket'>[</span><span class='id identifier rubyid_music_name'>music_name</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='cvar'>@@musics</span><span class='lbracket'>[</span><span class='id identifier rubyid_music_name'>music_name</span><span class='rbracket'>]</span>
328
+
329
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Initialize Music: &#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_music_name'>music_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span>
330
+
331
+ <span class='id identifier rubyid_file_name'>file_name</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='id identifier rubyid_base_path'>base_path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_music_name'>music_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>($|\.)</span><span class='regexp_end'>/</span></span> <span class='rbrace'>}</span>
332
+
333
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Music file not found with name &#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_music_name'>music_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
334
+
335
+ <span class='cvar'>@@musics</span><span class='lbracket'>[</span><span class='id identifier rubyid_music_name'>music_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Gosu</span><span class='op'>::</span><span class='const'>Song</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base_path'>base_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_name'>file_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
336
+
337
+ <span class='cvar'>@@musics</span><span class='lbracket'>[</span><span class='id identifier rubyid_music_name'>music_name</span><span class='rbracket'>]</span>
338
+ <span class='kw'>end</span></pre>
339
+ </td>
340
+ </tr>
341
+ </table>
342
+ </div>
343
+
344
+ <div class="method_details ">
345
+ <h3 class="signature " id="play-class_method">
346
+
347
+ .<strong>play</strong>(music_name, volume: nil) &#x21d2; <tt>Object</tt>
348
+
349
+
350
+
351
+
352
+
353
+ </h3><table class="source_code">
354
+ <tr>
355
+ <td>
356
+ <pre class="lines">
357
+
358
+
359
+ 8
360
+ 9
361
+ 10
362
+ 11
363
+ 12
364
+ 13
365
+ 14
366
+ 15</pre>
367
+ </td>
368
+ <td>
369
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 8</span>
370
+
371
+ <span class='kw'>def</span> <span class='id identifier rubyid_play'>play</span><span class='lparen'>(</span><span class='id identifier rubyid_music_name'>music_name</span><span class='comma'>,</span> <span class='label'>volume:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
372
+ <span class='id identifier rubyid_stop'>stop</span>
373
+
374
+ <span class='cvar'>@@actual_song</span> <span class='op'>=</span> <span class='id identifier rubyid_locate_music'>locate_music</span><span class='lparen'>(</span><span class='id identifier rubyid_music_name'>music_name</span><span class='rparen'>)</span>
375
+ <span class='cvar'>@@actual_song</span><span class='period'>.</span><span class='id identifier rubyid_play'>play</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
376
+
377
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_volume'>volume</span> <span class='op'>=</span> <span class='id identifier rubyid_volume'>volume</span> <span class='kw'>unless</span> <span class='id identifier rubyid_volume'>volume</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
378
+ <span class='kw'>end</span></pre>
379
+ </td>
380
+ </tr>
381
+ </table>
382
+ </div>
383
+
384
+ <div class="method_details ">
385
+ <h3 class="signature " id="preload_musics-class_method">
386
+
387
+ .<strong>preload_musics</strong> &#x21d2; <tt>Object</tt>
388
+
389
+
390
+
391
+
392
+
393
+ </h3><table class="source_code">
394
+ <tr>
395
+ <td>
396
+ <pre class="lines">
397
+
398
+
399
+ 43
400
+ 44
401
+ 45
402
+ 46
403
+ 47
404
+ 48
405
+ 49</pre>
406
+ </td>
407
+ <td>
408
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 43</span>
409
+
410
+ <span class='kw'>def</span> <span class='id identifier rubyid_preload_musics'>preload_musics</span>
411
+ <span class='kw'>return</span> <span class='kw'>unless</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_base_path'>base_path</span><span class='rparen'>)</span>
412
+
413
+ <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_each_child'>each_child</span><span class='lparen'>(</span><span class='id identifier rubyid_base_path'>base_path</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_file_name'>file_name</span><span class='op'>|</span>
414
+ <span class='id identifier rubyid_locate_music'>locate_music</span><span class='lparen'>(</span><span class='id identifier rubyid_file_name'>file_name</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
415
+ <span class='kw'>end</span>
416
+ <span class='kw'>end</span></pre>
417
+ </td>
418
+ </tr>
419
+ </table>
420
+ </div>
421
+
422
+ <div class="method_details ">
423
+ <h3 class="signature " id="stop-class_method">
424
+
425
+ .<strong>stop</strong> &#x21d2; <tt>Object</tt>
426
+
427
+
428
+
429
+
430
+
431
+ </h3><table class="source_code">
432
+ <tr>
433
+ <td>
434
+ <pre class="lines">
435
+
436
+
437
+ 17
438
+ 18
439
+ 19</pre>
440
+ </td>
441
+ <td>
442
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 17</span>
443
+
444
+ <span class='kw'>def</span> <span class='id identifier rubyid_stop'>stop</span>
445
+ <span class='cvar'>@@actual_song</span><span class='op'>&amp;.</span><span class='id identifier rubyid_stop'>stop</span>
446
+ <span class='kw'>end</span></pre>
447
+ </td>
448
+ </tr>
449
+ </table>
450
+ </div>
451
+
452
+ <div class="method_details ">
453
+ <h3 class="signature " id="volume-class_method">
454
+
455
+ .<strong>volume</strong> &#x21d2; <tt>Object</tt>
456
+
457
+
458
+
459
+
460
+
461
+ </h3><table class="source_code">
462
+ <tr>
463
+ <td>
464
+ <pre class="lines">
465
+
466
+
467
+ 21
468
+ 22
469
+ 23</pre>
470
+ </td>
471
+ <td>
472
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 21</span>
473
+
474
+ <span class='kw'>def</span> <span class='id identifier rubyid_volume'>volume</span>
475
+ <span class='cvar'>@@actual_song</span><span class='op'>&amp;.</span><span class='id identifier rubyid_volume'>volume</span>
476
+ <span class='kw'>end</span></pre>
477
+ </td>
478
+ </tr>
479
+ </table>
480
+ </div>
481
+
482
+ <div class="method_details ">
483
+ <h3 class="signature " id="volume=-class_method">
484
+
485
+ .<strong>volume=</strong>(value) &#x21d2; <tt>Object</tt>
486
+
487
+
488
+
489
+
490
+
491
+ </h3><table class="source_code">
492
+ <tr>
493
+ <td>
494
+ <pre class="lines">
495
+
496
+
497
+ 25
498
+ 26
499
+ 27</pre>
500
+ </td>
501
+ <td>
502
+ <pre class="code"><span class="info file"># File 'lib/fantasy/music.rb', line 25</span>
503
+
504
+ <span class='kw'>def</span> <span class='id identifier rubyid_volume='>volume=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
505
+ <span class='cvar'>@@actual_song</span><span class='period'>.</span><span class='id identifier rubyid_volume'>volume</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>unless</span> <span class='cvar'>@@actual_song</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
506
+ <span class='kw'>end</span></pre>
507
+ </td>
508
+ </tr>
509
+ </table>
510
+ </div>
511
+
512
+ </div>
513
+
514
+ </div>
515
+
516
+ <div id="footer">
517
+ Generated on Sat Apr 2 14:24:12 2022 by
518
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
519
+ 0.9.27 (ruby-3.0.2).
520
+ </div>
521
+
522
+ </div>
523
+ </body>
524
+ </html>