fantasy 0.1.13 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +22 -1
- data/.yardopts +4 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +55 -0
- data/README.md +14 -6
- data/docs/Actor.html +2737 -0
- data/docs/Background.html +961 -0
- data/docs/Camera.html +791 -0
- data/docs/Clock.html +753 -0
- data/docs/Color.html +776 -0
- data/docs/Coordinates.html +730 -0
- data/docs/Cursor.html +752 -0
- data/docs/Disk.html +236 -0
- data/docs/Draggable.html +198 -0
- data/docs/Fantasy.html +121 -0
- data/docs/Game.html +904 -0
- data/docs/Global.html +2791 -0
- data/docs/Gravitier.html +179 -0
- data/docs/HudImage.html +979 -0
- data/docs/HudText.html +1151 -0
- data/docs/Image.html +506 -0
- data/docs/Jumper.html +189 -0
- data/docs/Mouse.html +226 -0
- data/docs/MoveByCursor.html +374 -0
- data/docs/MoveByDirection.html +179 -0
- data/docs/Mover.html +305 -0
- data/docs/Music.html +524 -0
- data/docs/Shape.html +1057 -0
- data/docs/Sound.html +374 -0
- data/docs/Tilemap.html +491 -0
- data/docs/Tween.html +186 -0
- data/docs/UserInputs.html +879 -0
- data/docs/Utils.html +345 -0
- data/docs/_index.html +346 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +497 -0
- data/docs/file.CHANGELOG.html +121 -0
- data/docs/file.README.html +599 -0
- data/docs/file_list.html +61 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +599 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1931 -0
- data/docs/top-level-namespace.html +978 -0
- data/lib/fantasy/actor.rb +455 -123
- data/lib/fantasy/background.rb +109 -13
- data/lib/fantasy/base.rb +113 -1
- data/lib/fantasy/camera.rb +95 -11
- data/lib/fantasy/clock.rb +4 -2
- data/lib/fantasy/color.rb +158 -153
- data/lib/fantasy/coordinates.rb +5 -9
- data/lib/fantasy/cursor.rb +2 -1
- data/lib/fantasy/disk.rb +12 -8
- data/lib/fantasy/draggable.rb +22 -1
- data/lib/fantasy/global.rb +59 -31
- data/lib/fantasy/hud_image.rb +5 -3
- data/lib/fantasy/hud_text.rb +6 -2
- data/lib/fantasy/image.rb +12 -4
- data/lib/fantasy/includes/gravitier.rb +2 -0
- data/lib/fantasy/includes/jumper.rb +3 -2
- data/lib/fantasy/includes/log.rb +12 -0
- data/lib/fantasy/includes/move_by_cursors.rb +24 -15
- data/lib/fantasy/includes/move_by_direction.rb +2 -0
- data/lib/fantasy/includes/mover.rb +3 -0
- data/lib/fantasy/includes/user_inputs.rb +6 -0
- data/lib/fantasy/loop.rb +41 -44
- data/lib/fantasy/mouse.rb +2 -0
- data/lib/fantasy/music.rb +4 -2
- data/lib/fantasy/shape.rb +11 -2
- data/lib/fantasy/sound.rb +3 -1
- data/lib/fantasy/tilemap.rb +19 -13
- data/lib/fantasy/tween.rb +3 -1
- data/lib/fantasy/utils.rb +7 -13
- data/lib/fantasy/version.rb +1 -1
- data/lib/fantasy.rb +2 -0
- metadata +90 -4
- data/fantasy.gemspec +0 -40
- data/fonts/VT323-Regular.ttf +0 -0
@@ -0,0 +1,978 @@
|
|
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
|
+
Top Level Namespace
|
8
|
+
|
9
|
+
— 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 = "";
|
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</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Top Level Namespace</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>Top Level Namespace
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<h2>Defined Under Namespace</h2>
|
82
|
+
<p class="children">
|
83
|
+
|
84
|
+
|
85
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Cursor.html" title="Cursor (module)">Cursor</a></span>, <span class='object_link'><a href="Disk.html" title="Disk (module)">Disk</a></span>, <span class='object_link'><a href="Draggable.html" title="Draggable (module)">Draggable</a></span>, <span class='object_link'><a href="Fantasy.html" title="Fantasy (module)">Fantasy</a></span>, <span class='object_link'><a href="Global.html" title="Global (module)">Global</a></span>, <span class='object_link'><a href="Gravitier.html" title="Gravitier (module)">Gravitier</a></span>, <span class='object_link'><a href="Jumper.html" title="Jumper (module)">Jumper</a></span>, <span class='object_link'><a href="Mouse.html" title="Mouse (module)">Mouse</a></span>, <span class='object_link'><a href="MoveByCursor.html" title="MoveByCursor (module)">MoveByCursor</a></span>, <span class='object_link'><a href="MoveByDirection.html" title="MoveByDirection (module)">MoveByDirection</a></span>, <span class='object_link'><a href="Mover.html" title="Mover (module)">Mover</a></span>, <span class='object_link'><a href="Music.html" title="Music (module)">Music</a></span>, <span class='object_link'><a href="Sound.html" title="Sound (module)">Sound</a></span>, <span class='object_link'><a href="Tween.html" title="Tween (module)">Tween</a></span>, <span class='object_link'><a href="UserInputs.html" title="UserInputs (module)">UserInputs</a></span>, <span class='object_link'><a href="Utils.html" title="Utils (module)">Utils</a></span>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Actor.html" title="Actor (class)">Actor</a></span>, <span class='object_link'><a href="Background.html" title="Background (class)">Background</a></span>, <span class='object_link'><a href="Camera.html" title="Camera (class)">Camera</a></span>, <span class='object_link'><a href="Clock.html" title="Clock (class)">Clock</a></span>, <span class='object_link'><a href="Color.html" title="Color (class)">Color</a></span>, <span class='object_link'><a href="Coordinates.html" title="Coordinates (class)">Coordinates</a></span>, <span class='object_link'><a href="Game.html" title="Game (class)">Game</a></span>, <span class='object_link'><a href="HudImage.html" title="HudImage (class)">HudImage</a></span>, <span class='object_link'><a href="HudText.html" title="HudText (class)">HudText</a></span>, <span class='object_link'><a href="Image.html" title="Image (class)">Image</a></span>, <span class='object_link'><a href="Shape.html" title="Shape (class)">Shape</a></span>, <span class='object_link'><a href="Tilemap.html" title="Tilemap (class)">Tilemap</a></span>
|
90
|
+
|
91
|
+
|
92
|
+
</p>
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<h2>
|
102
|
+
Instance Method Summary
|
103
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
104
|
+
</h2>
|
105
|
+
|
106
|
+
<ul class="summary">
|
107
|
+
|
108
|
+
<li class="public ">
|
109
|
+
<span class="summary_signature">
|
110
|
+
|
111
|
+
<a href="top-level-namespace.html#on_cursor_down-instance_method" title="#on_cursor_down (instance method)">#<strong>on_cursor_down</strong>(&block) ⇒ Object </a>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
</span>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time cursor down key is pressed.</p>
|
126
|
+
</div></span>
|
127
|
+
|
128
|
+
</li>
|
129
|
+
|
130
|
+
|
131
|
+
<li class="public ">
|
132
|
+
<span class="summary_signature">
|
133
|
+
|
134
|
+
<a href="top-level-namespace.html#on_cursor_left-instance_method" title="#on_cursor_left (instance method)">#<strong>on_cursor_left</strong>(&block) ⇒ Object </a>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time cursor left key is pressed.</p>
|
149
|
+
</div></span>
|
150
|
+
|
151
|
+
</li>
|
152
|
+
|
153
|
+
|
154
|
+
<li class="public ">
|
155
|
+
<span class="summary_signature">
|
156
|
+
|
157
|
+
<a href="top-level-namespace.html#on_cursor_right-instance_method" title="#on_cursor_right (instance method)">#<strong>on_cursor_right</strong>(&block) ⇒ Object </a>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time cursor right key is pressed.</p>
|
172
|
+
</div></span>
|
173
|
+
|
174
|
+
</li>
|
175
|
+
|
176
|
+
|
177
|
+
<li class="public ">
|
178
|
+
<span class="summary_signature">
|
179
|
+
|
180
|
+
<a href="top-level-namespace.html#on_cursor_up-instance_method" title="#on_cursor_up (instance method)">#<strong>on_cursor_up</strong>(&block) ⇒ Object </a>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</span>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time cursor up key is pressed.</p>
|
195
|
+
</div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
<li class="public ">
|
201
|
+
<span class="summary_signature">
|
202
|
+
|
203
|
+
<a href="top-level-namespace.html#on_end-instance_method" title="#on_end (instance method)">#<strong>on_end</strong>(&block) ⇒ Object </a>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</span>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
<span class="summary_desc"><div class='inline'><p>Defines the end Scene.</p>
|
218
|
+
</div></span>
|
219
|
+
|
220
|
+
</li>
|
221
|
+
|
222
|
+
|
223
|
+
<li class="public ">
|
224
|
+
<span class="summary_signature">
|
225
|
+
|
226
|
+
<a href="top-level-namespace.html#on_game-instance_method" title="#on_game (instance method)">#<strong>on_game</strong>(&block) ⇒ Object </a>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
</span>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<span class="summary_desc"><div class='inline'><p>Defines the game Scene.</p>
|
241
|
+
</div></span>
|
242
|
+
|
243
|
+
</li>
|
244
|
+
|
245
|
+
|
246
|
+
<li class="public ">
|
247
|
+
<span class="summary_signature">
|
248
|
+
|
249
|
+
<a href="top-level-namespace.html#on_loop-instance_method" title="#on_loop (instance method)">#<strong>on_loop</strong>(&block) ⇒ Object </a>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</span>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<span class="summary_desc"><div class='inline'><p>Executes on every frame.</p>
|
264
|
+
</div></span>
|
265
|
+
|
266
|
+
</li>
|
267
|
+
|
268
|
+
|
269
|
+
<li class="public ">
|
270
|
+
<span class="summary_signature">
|
271
|
+
|
272
|
+
<a href="top-level-namespace.html#on_mouse_button_left-instance_method" title="#on_mouse_button_left (instance method)">#<strong>on_mouse_button_left</strong>(&block) ⇒ Object </a>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
</span>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time mouse left button is pressed.</p>
|
287
|
+
</div></span>
|
288
|
+
|
289
|
+
</li>
|
290
|
+
|
291
|
+
|
292
|
+
<li class="public ">
|
293
|
+
<span class="summary_signature">
|
294
|
+
|
295
|
+
<a href="top-level-namespace.html#on_mouse_button_right-instance_method" title="#on_mouse_button_right (instance method)">#<strong>on_mouse_button_right</strong>(&block) ⇒ Object </a>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
</span>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time mouse right button is pressed.</p>
|
310
|
+
</div></span>
|
311
|
+
|
312
|
+
</li>
|
313
|
+
|
314
|
+
|
315
|
+
<li class="public ">
|
316
|
+
<span class="summary_signature">
|
317
|
+
|
318
|
+
<a href="top-level-namespace.html#on_presentation-instance_method" title="#on_presentation (instance method)">#<strong>on_presentation</strong>(&block) ⇒ Object </a>
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
</span>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<span class="summary_desc"><div class='inline'><p>Defines the presentation Scene.</p>
|
333
|
+
</div></span>
|
334
|
+
|
335
|
+
</li>
|
336
|
+
|
337
|
+
|
338
|
+
<li class="public ">
|
339
|
+
<span class="summary_signature">
|
340
|
+
|
341
|
+
<a href="top-level-namespace.html#on_space_bar-instance_method" title="#on_space_bar (instance method)">#<strong>on_space_bar</strong>(&block) ⇒ Object </a>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
</span>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<span class="summary_desc"><div class='inline'><p>Triggered any time space bar key is pressed.</p>
|
356
|
+
</div></span>
|
357
|
+
|
358
|
+
</li>
|
359
|
+
|
360
|
+
|
361
|
+
<li class="public ">
|
362
|
+
<span class="summary_signature">
|
363
|
+
|
364
|
+
<a href="top-level-namespace.html#start!-instance_method" title="#start! (instance method)">#<strong>start!</strong> ⇒ Object </a>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
</span>
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
<span class="summary_desc"><div class='inline'><p>Starts the game.</p>
|
379
|
+
</div></span>
|
380
|
+
|
381
|
+
</li>
|
382
|
+
|
383
|
+
|
384
|
+
</ul>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
<div id="instance_method_details" class="method_details_list">
|
390
|
+
<h2>Instance Method Details</h2>
|
391
|
+
|
392
|
+
|
393
|
+
<div class="method_details first">
|
394
|
+
<h3 class="signature first" id="on_cursor_down-instance_method">
|
395
|
+
|
396
|
+
#<strong>on_cursor_down</strong>(&block) ⇒ <tt>Object</tt>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
</h3><div class="docstring">
|
403
|
+
<div class="discussion">
|
404
|
+
<p>Triggered any time cursor down key is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
405
|
+
|
406
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
407
|
+
<span class='id identifier rubyid_on_cursor_down'>on_cursor_down</span> <span class='kw'>do</span>
|
408
|
+
<span class='id identifier rubyid_look_down'>look_down</span> <span class='comment'># for example
|
409
|
+
</span> <span class='kw'>end</span>
|
410
|
+
<span class='kw'>end</span>
|
411
|
+
</code></pre>
|
412
|
+
|
413
|
+
|
414
|
+
</div>
|
415
|
+
</div>
|
416
|
+
<div class="tags">
|
417
|
+
|
418
|
+
|
419
|
+
</div><table class="source_code">
|
420
|
+
<tr>
|
421
|
+
<td>
|
422
|
+
<pre class="lines">
|
423
|
+
|
424
|
+
|
425
|
+
106
|
426
|
+
107
|
427
|
+
108</pre>
|
428
|
+
</td>
|
429
|
+
<td>
|
430
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 106</span>
|
431
|
+
|
432
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_cursor_down'>on_cursor_down</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
433
|
+
<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_cursor_down_proc'><span class='object_link'><a href="Global.html#cursor_down_proc-class_method" title="Global.cursor_down_proc (method)">cursor_down_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
434
|
+
<span class='kw'>end</span></pre>
|
435
|
+
</td>
|
436
|
+
</tr>
|
437
|
+
</table>
|
438
|
+
</div>
|
439
|
+
|
440
|
+
<div class="method_details ">
|
441
|
+
<h3 class="signature " id="on_cursor_left-instance_method">
|
442
|
+
|
443
|
+
#<strong>on_cursor_left</strong>(&block) ⇒ <tt>Object</tt>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
</h3><div class="docstring">
|
450
|
+
<div class="discussion">
|
451
|
+
<p>Triggered any time cursor left key is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
452
|
+
|
453
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
454
|
+
<span class='id identifier rubyid_on_cursor_left'>on_cursor_left</span> <span class='kw'>do</span>
|
455
|
+
<span class='id identifier rubyid_look_left'>look_left</span> <span class='comment'># for example
|
456
|
+
</span> <span class='kw'>end</span>
|
457
|
+
<span class='kw'>end</span>
|
458
|
+
</code></pre>
|
459
|
+
|
460
|
+
|
461
|
+
</div>
|
462
|
+
</div>
|
463
|
+
<div class="tags">
|
464
|
+
|
465
|
+
|
466
|
+
</div><table class="source_code">
|
467
|
+
<tr>
|
468
|
+
<td>
|
469
|
+
<pre class="lines">
|
470
|
+
|
471
|
+
|
472
|
+
118
|
473
|
+
119
|
474
|
+
120</pre>
|
475
|
+
</td>
|
476
|
+
<td>
|
477
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 118</span>
|
478
|
+
|
479
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_cursor_left'>on_cursor_left</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
480
|
+
<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_cursor_left_proc'><span class='object_link'><a href="Global.html#cursor_left_proc-class_method" title="Global.cursor_left_proc (method)">cursor_left_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
481
|
+
<span class='kw'>end</span></pre>
|
482
|
+
</td>
|
483
|
+
</tr>
|
484
|
+
</table>
|
485
|
+
</div>
|
486
|
+
|
487
|
+
<div class="method_details ">
|
488
|
+
<h3 class="signature " id="on_cursor_right-instance_method">
|
489
|
+
|
490
|
+
#<strong>on_cursor_right</strong>(&block) ⇒ <tt>Object</tt>
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
</h3><div class="docstring">
|
497
|
+
<div class="discussion">
|
498
|
+
<p>Triggered any time cursor right key is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
499
|
+
|
500
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
501
|
+
<span class='id identifier rubyid_on_cursor_right'>on_cursor_right</span> <span class='kw'>do</span>
|
502
|
+
<span class='id identifier rubyid_look_right'>look_right</span> <span class='comment'># for example
|
503
|
+
</span> <span class='kw'>end</span>
|
504
|
+
<span class='kw'>end</span>
|
505
|
+
</code></pre>
|
506
|
+
|
507
|
+
|
508
|
+
</div>
|
509
|
+
</div>
|
510
|
+
<div class="tags">
|
511
|
+
|
512
|
+
|
513
|
+
</div><table class="source_code">
|
514
|
+
<tr>
|
515
|
+
<td>
|
516
|
+
<pre class="lines">
|
517
|
+
|
518
|
+
|
519
|
+
130
|
520
|
+
131
|
521
|
+
132</pre>
|
522
|
+
</td>
|
523
|
+
<td>
|
524
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 130</span>
|
525
|
+
|
526
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_cursor_right'>on_cursor_right</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
527
|
+
<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_cursor_right_proc'><span class='object_link'><a href="Global.html#cursor_right_proc-class_method" title="Global.cursor_right_proc (method)">cursor_right_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
528
|
+
<span class='kw'>end</span></pre>
|
529
|
+
</td>
|
530
|
+
</tr>
|
531
|
+
</table>
|
532
|
+
</div>
|
533
|
+
|
534
|
+
<div class="method_details ">
|
535
|
+
<h3 class="signature " id="on_cursor_up-instance_method">
|
536
|
+
|
537
|
+
#<strong>on_cursor_up</strong>(&block) ⇒ <tt>Object</tt>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
</h3><div class="docstring">
|
544
|
+
<div class="discussion">
|
545
|
+
<p>Triggered any time cursor up key is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
546
|
+
|
547
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
548
|
+
<span class='id identifier rubyid_on_cursor_up'>on_cursor_up</span> <span class='kw'>do</span>
|
549
|
+
<span class='id identifier rubyid_look_ups'>look_ups</span> <span class='comment'># for example
|
550
|
+
</span> <span class='kw'>end</span>
|
551
|
+
<span class='kw'>end</span>
|
552
|
+
</code></pre>
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
</div>
|
557
|
+
<div class="tags">
|
558
|
+
|
559
|
+
|
560
|
+
</div><table class="source_code">
|
561
|
+
<tr>
|
562
|
+
<td>
|
563
|
+
<pre class="lines">
|
564
|
+
|
565
|
+
|
566
|
+
94
|
567
|
+
95
|
568
|
+
96</pre>
|
569
|
+
</td>
|
570
|
+
<td>
|
571
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 94</span>
|
572
|
+
|
573
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_cursor_up'>on_cursor_up</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
574
|
+
<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_cursor_up_proc'><span class='object_link'><a href="Global.html#cursor_up_proc-class_method" title="Global.cursor_up_proc (method)">cursor_up_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
575
|
+
<span class='kw'>end</span></pre>
|
576
|
+
</td>
|
577
|
+
</tr>
|
578
|
+
</table>
|
579
|
+
</div>
|
580
|
+
|
581
|
+
<div class="method_details ">
|
582
|
+
<h3 class="signature " id="on_end-instance_method">
|
583
|
+
|
584
|
+
#<strong>on_end</strong>(&block) ⇒ <tt>Object</tt>
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
|
590
|
+
</h3><div class="docstring">
|
591
|
+
<div class="discussion">
|
592
|
+
<p>Defines the end Scene</p>
|
593
|
+
|
594
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_end'>on_end</span> <span class='kw'>do</span>
|
595
|
+
<span class='const'><span class='object_link'><a href="HudText.html" title="HudText (class)">HudText</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="HudText.html#initialize-instance_method" title="HudText#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>position:</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_new'>new</span><span class='lparen'>(</span><span class='int'>10</span><span class='comma'>,</span> <span class='int'>100</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>text:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>You are dead. Press space to re-tart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
596
|
+
|
597
|
+
<span class='id identifier rubyid_on_space_bar'><span class='object_link'><a href="#on_space_bar-instance_method" title="#on_space_bar (method)">on_space_bar</a></span></span> <span class='kw'>do</span>
|
598
|
+
<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_go_to_presentation'><span class='object_link'><a href="Global.html#go_to_presentation-class_method" title="Global.go_to_presentation (method)">go_to_presentation</a></span></span>
|
599
|
+
<span class='kw'>end</span>
|
600
|
+
<span class='kw'>end</span>
|
601
|
+
</code></pre>
|
602
|
+
|
603
|
+
|
604
|
+
</div>
|
605
|
+
</div>
|
606
|
+
<div class="tags">
|
607
|
+
|
608
|
+
|
609
|
+
</div><table class="source_code">
|
610
|
+
<tr>
|
611
|
+
<td>
|
612
|
+
<pre class="lines">
|
613
|
+
|
614
|
+
|
615
|
+
48
|
616
|
+
49
|
617
|
+
50</pre>
|
618
|
+
</td>
|
619
|
+
<td>
|
620
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 48</span>
|
621
|
+
|
622
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_end'>on_end</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
623
|
+
<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_end_proc'><span class='object_link'><a href="Global.html#end_proc-class_method" title="Global.end_proc (method)">end_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
624
|
+
<span class='kw'>end</span></pre>
|
625
|
+
</td>
|
626
|
+
</tr>
|
627
|
+
</table>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
<div class="method_details ">
|
631
|
+
<h3 class="signature " id="on_game-instance_method">
|
632
|
+
|
633
|
+
#<strong>on_game</strong>(&block) ⇒ <tt>Object</tt>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
</h3><div class="docstring">
|
640
|
+
<div class="discussion">
|
641
|
+
<p>Defines the game Scene</p>
|
642
|
+
|
643
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'>on_game</span> <span class='kw'>do</span>
|
644
|
+
<span class='comment'># [...]
|
645
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_player'>player</span><span class='period'>.</span><span class='id identifier rubyid_dead'>dead</span>
|
646
|
+
<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_go_to_end'><span class='object_link'><a href="Global.html#go_to_end-class_method" title="Global.go_to_end (method)">go_to_end</a></span></span>
|
647
|
+
<span class='kw'>end</span>
|
648
|
+
<span class='kw'>end</span>
|
649
|
+
</code></pre>
|
650
|
+
|
651
|
+
|
652
|
+
</div>
|
653
|
+
</div>
|
654
|
+
<div class="tags">
|
655
|
+
|
656
|
+
|
657
|
+
</div><table class="source_code">
|
658
|
+
<tr>
|
659
|
+
<td>
|
660
|
+
<pre class="lines">
|
661
|
+
|
662
|
+
|
663
|
+
33
|
664
|
+
34
|
665
|
+
35</pre>
|
666
|
+
</td>
|
667
|
+
<td>
|
668
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 33</span>
|
669
|
+
|
670
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_game'>on_game</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
671
|
+
<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_game_proc'><span class='object_link'><a href="Global.html#game_proc-class_method" title="Global.game_proc (method)">game_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
672
|
+
<span class='kw'>end</span></pre>
|
673
|
+
</td>
|
674
|
+
</tr>
|
675
|
+
</table>
|
676
|
+
</div>
|
677
|
+
|
678
|
+
<div class="method_details ">
|
679
|
+
<h3 class="signature " id="on_loop-instance_method">
|
680
|
+
|
681
|
+
#<strong>on_loop</strong>(&block) ⇒ <tt>Object</tt>
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
</h3><div class="docstring">
|
688
|
+
<div class="discussion">
|
689
|
+
<p>Executes on every frame. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
690
|
+
|
691
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
692
|
+
<span class='id identifier rubyid_on_loop'>on_loop</span> <span class='kw'>do</span>
|
693
|
+
<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_references'><span class='object_link'><a href="Global.html#references-class_method" title="Global.references (method)">references</a></span></span><span class='period'>.</span><span class='id identifier rubyid_time'>time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</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_seconds_in_scene'><span class='object_link'><a href="Global.html#seconds_in_scene-class_method" title="Global.seconds_in_scene (method)">seconds_in_scene</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%M:%S</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
694
|
+
<span class='kw'>end</span>
|
695
|
+
<span class='kw'>end</span>
|
696
|
+
</code></pre>
|
697
|
+
|
698
|
+
|
699
|
+
</div>
|
700
|
+
</div>
|
701
|
+
<div class="tags">
|
702
|
+
|
703
|
+
|
704
|
+
</div><table class="source_code">
|
705
|
+
<tr>
|
706
|
+
<td>
|
707
|
+
<pre class="lines">
|
708
|
+
|
709
|
+
|
710
|
+
65
|
711
|
+
66
|
712
|
+
67</pre>
|
713
|
+
</td>
|
714
|
+
<td>
|
715
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 65</span>
|
716
|
+
|
717
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_loop'>on_loop</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
718
|
+
<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_loop_proc'><span class='object_link'><a href="Global.html#loop_proc-class_method" title="Global.loop_proc (method)">loop_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
719
|
+
<span class='kw'>end</span></pre>
|
720
|
+
</td>
|
721
|
+
</tr>
|
722
|
+
</table>
|
723
|
+
</div>
|
724
|
+
|
725
|
+
<div class="method_details ">
|
726
|
+
<h3 class="signature " id="on_mouse_button_left-instance_method">
|
727
|
+
|
728
|
+
#<strong>on_mouse_button_left</strong>(&block) ⇒ <tt>Object</tt>
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
</h3><div class="docstring">
|
735
|
+
<div class="discussion">
|
736
|
+
<p>Triggered any time mouse left button is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
737
|
+
|
738
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
739
|
+
<span class='id identifier rubyid_on_mouse_button_left'>on_mouse_button_left</span> <span class='kw'>do</span>
|
740
|
+
<span class='id identifier rubyid_show_menu'>show_menu</span> <span class='comment'># for example
|
741
|
+
</span> <span class='kw'>end</span>
|
742
|
+
<span class='kw'>end</span>
|
743
|
+
</code></pre>
|
744
|
+
|
745
|
+
|
746
|
+
</div>
|
747
|
+
</div>
|
748
|
+
<div class="tags">
|
749
|
+
|
750
|
+
|
751
|
+
</div><table class="source_code">
|
752
|
+
<tr>
|
753
|
+
<td>
|
754
|
+
<pre class="lines">
|
755
|
+
|
756
|
+
|
757
|
+
142
|
758
|
+
143
|
759
|
+
144</pre>
|
760
|
+
</td>
|
761
|
+
<td>
|
762
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 142</span>
|
763
|
+
|
764
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_mouse_button_left'>on_mouse_button_left</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
765
|
+
<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_mouse_button_left_proc'><span class='object_link'><a href="Global.html#mouse_button_left_proc-class_method" title="Global.mouse_button_left_proc (method)">mouse_button_left_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
766
|
+
<span class='kw'>end</span></pre>
|
767
|
+
</td>
|
768
|
+
</tr>
|
769
|
+
</table>
|
770
|
+
</div>
|
771
|
+
|
772
|
+
<div class="method_details ">
|
773
|
+
<h3 class="signature " id="on_mouse_button_right-instance_method">
|
774
|
+
|
775
|
+
#<strong>on_mouse_button_right</strong>(&block) ⇒ <tt>Object</tt>
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
|
781
|
+
</h3><div class="docstring">
|
782
|
+
<div class="discussion">
|
783
|
+
<p>Triggered any time mouse right button is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
784
|
+
|
785
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
786
|
+
<span class='id identifier rubyid_on_mouse_button_right'>on_mouse_button_right</span> <span class='kw'>do</span>
|
787
|
+
<span class='id identifier rubyid_show_menu'>show_menu</span> <span class='comment'># for example
|
788
|
+
</span> <span class='kw'>end</span>
|
789
|
+
<span class='kw'>end</span>
|
790
|
+
</code></pre>
|
791
|
+
|
792
|
+
|
793
|
+
</div>
|
794
|
+
</div>
|
795
|
+
<div class="tags">
|
796
|
+
|
797
|
+
|
798
|
+
</div><table class="source_code">
|
799
|
+
<tr>
|
800
|
+
<td>
|
801
|
+
<pre class="lines">
|
802
|
+
|
803
|
+
|
804
|
+
154
|
805
|
+
155
|
806
|
+
156</pre>
|
807
|
+
</td>
|
808
|
+
<td>
|
809
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 154</span>
|
810
|
+
|
811
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_mouse_button_right'>on_mouse_button_right</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
812
|
+
<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_mouse_button_right_proc'><span class='object_link'><a href="Global.html#mouse_button_right_proc-class_method" title="Global.mouse_button_right_proc (method)">mouse_button_right_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
813
|
+
<span class='kw'>end</span></pre>
|
814
|
+
</td>
|
815
|
+
</tr>
|
816
|
+
</table>
|
817
|
+
</div>
|
818
|
+
|
819
|
+
<div class="method_details ">
|
820
|
+
<h3 class="signature " id="on_presentation-instance_method">
|
821
|
+
|
822
|
+
#<strong>on_presentation</strong>(&block) ⇒ <tt>Object</tt>
|
823
|
+
|
824
|
+
|
825
|
+
|
826
|
+
|
827
|
+
|
828
|
+
</h3><div class="docstring">
|
829
|
+
<div class="discussion">
|
830
|
+
<p>Defines the presentation Scene</p>
|
831
|
+
|
832
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_presentation'>on_presentation</span> <span class='kw'>do</span>
|
833
|
+
<span class='const'><span class='object_link'><a href="HudText.html" title="HudText (class)">HudText</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="HudText.html#initialize-instance_method" title="HudText#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>position:</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_new'>new</span><span class='lparen'>(</span><span class='int'>10</span><span class='comma'>,</span> <span class='int'>100</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>text:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Press space to start</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
834
|
+
|
835
|
+
<span class='id identifier rubyid_on_space_bar'><span class='object_link'><a href="#on_space_bar-instance_method" title="#on_space_bar (method)">on_space_bar</a></span></span> <span class='kw'>do</span>
|
836
|
+
<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_go_to_game'><span class='object_link'><a href="Global.html#go_to_game-class_method" title="Global.go_to_game (method)">go_to_game</a></span></span>
|
837
|
+
<span class='kw'>end</span>
|
838
|
+
<span class='kw'>end</span>
|
839
|
+
</code></pre>
|
840
|
+
|
841
|
+
|
842
|
+
</div>
|
843
|
+
</div>
|
844
|
+
<div class="tags">
|
845
|
+
|
846
|
+
|
847
|
+
</div><table class="source_code">
|
848
|
+
<tr>
|
849
|
+
<td>
|
850
|
+
<pre class="lines">
|
851
|
+
|
852
|
+
|
853
|
+
19
|
854
|
+
20
|
855
|
+
21</pre>
|
856
|
+
</td>
|
857
|
+
<td>
|
858
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 19</span>
|
859
|
+
|
860
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_presentation'>on_presentation</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
861
|
+
<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_presentation_proc'><span class='object_link'><a href="Global.html#presentation_proc-class_method" title="Global.presentation_proc (method)">presentation_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
862
|
+
<span class='kw'>end</span></pre>
|
863
|
+
</td>
|
864
|
+
</tr>
|
865
|
+
</table>
|
866
|
+
</div>
|
867
|
+
|
868
|
+
<div class="method_details ">
|
869
|
+
<h3 class="signature " id="on_space_bar-instance_method">
|
870
|
+
|
871
|
+
#<strong>on_space_bar</strong>(&block) ⇒ <tt>Object</tt>
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
|
877
|
+
</h3><div class="docstring">
|
878
|
+
<div class="discussion">
|
879
|
+
<p>Triggered any time space bar key is pressed. To be used inside one of the scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>)</p>
|
880
|
+
|
881
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
882
|
+
<span class='id identifier rubyid_on_space_bar'>on_space_bar</span> <span class='kw'>do</span>
|
883
|
+
<span class='id identifier rubyid_shoot_gun'>shoot_gun</span> <span class='comment'># for example
|
884
|
+
</span> <span class='kw'>end</span>
|
885
|
+
<span class='kw'>end</span>
|
886
|
+
</code></pre>
|
887
|
+
|
888
|
+
|
889
|
+
</div>
|
890
|
+
</div>
|
891
|
+
<div class="tags">
|
892
|
+
|
893
|
+
|
894
|
+
</div><table class="source_code">
|
895
|
+
<tr>
|
896
|
+
<td>
|
897
|
+
<pre class="lines">
|
898
|
+
|
899
|
+
|
900
|
+
82
|
901
|
+
83
|
902
|
+
84</pre>
|
903
|
+
</td>
|
904
|
+
<td>
|
905
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 82</span>
|
906
|
+
|
907
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_space_bar'>on_space_bar</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
908
|
+
<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_space_bar_proc'><span class='object_link'><a href="Global.html#space_bar_proc-class_method" title="Global.space_bar_proc (method)">space_bar_proc</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
909
|
+
<span class='kw'>end</span></pre>
|
910
|
+
</td>
|
911
|
+
</tr>
|
912
|
+
</table>
|
913
|
+
</div>
|
914
|
+
|
915
|
+
<div class="method_details ">
|
916
|
+
<h3 class="signature " id="start!-instance_method">
|
917
|
+
|
918
|
+
#<strong>start!</strong> ⇒ <tt>Object</tt>
|
919
|
+
|
920
|
+
|
921
|
+
|
922
|
+
|
923
|
+
|
924
|
+
</h3><div class="docstring">
|
925
|
+
<div class="discussion">
|
926
|
+
<p>Starts the game. This method has to be called when all the desired scene blocks (<code>on_presentation</code>, <code>on_game</code>, <code>on_end</code>) have been declared.</p>
|
927
|
+
|
928
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_on_game'><span class='object_link'><a href="#on_game-instance_method" title="#on_game (method)">on_game</a></span></span> <span class='kw'>do</span>
|
929
|
+
<span class='comment'># do game stuff
|
930
|
+
</span><span class='kw'>end</span>
|
931
|
+
|
932
|
+
<span class='id identifier rubyid_start!'>start!</span>
|
933
|
+
</code></pre>
|
934
|
+
|
935
|
+
|
936
|
+
</div>
|
937
|
+
</div>
|
938
|
+
<div class="tags">
|
939
|
+
|
940
|
+
|
941
|
+
</div><table class="source_code">
|
942
|
+
<tr>
|
943
|
+
<td>
|
944
|
+
<pre class="lines">
|
945
|
+
|
946
|
+
|
947
|
+
166
|
948
|
+
167
|
949
|
+
168
|
950
|
+
169
|
951
|
+
170</pre>
|
952
|
+
</td>
|
953
|
+
<td>
|
954
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/base.rb', line 166</span>
|
955
|
+
|
956
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_start!'>start!</span>
|
957
|
+
<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_setup'><span class='object_link'><a href="Global.html#setup-class_method" title="Global.setup (method)">setup</a></span></span>
|
958
|
+
<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_game'><span class='object_link'><a href="Global.html#game-class_method" title="Global.game (method)">game</a></span></span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Game.html" title="Game (class)">Game</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Game.html#initialize-instance_method" title="Game#initialize (method)">new</a></span></span>
|
959
|
+
<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_game'><span class='object_link'><a href="Global.html#game-class_method" title="Global.game (method)">game</a></span></span><span class='period'>.</span><span class='id identifier rubyid_show'>show</span>
|
960
|
+
<span class='kw'>end</span></pre>
|
961
|
+
</td>
|
962
|
+
</tr>
|
963
|
+
</table>
|
964
|
+
</div>
|
965
|
+
|
966
|
+
</div>
|
967
|
+
|
968
|
+
</div>
|
969
|
+
|
970
|
+
<div id="footer">
|
971
|
+
Generated on Sat Apr 2 14:24:11 2022 by
|
972
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
973
|
+
0.9.27 (ruby-3.0.2).
|
974
|
+
</div>
|
975
|
+
|
976
|
+
</div>
|
977
|
+
</body>
|
978
|
+
</html>
|