dxopal 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.ignore +5 -0
  4. data/.nojekyll +4 -0
  5. data/CHANGELOG.md +90 -0
  6. data/DEVELOPMENT.md +57 -0
  7. data/Gemfile +2 -0
  8. data/Gemfile.lock +39 -0
  9. data/README.md +22 -0
  10. data/Rakefile +66 -0
  11. data/TODO.md +278 -0
  12. data/build/dxopal.js +46590 -0
  13. data/build/dxopal.min.js +1 -0
  14. data/config.ru +39 -0
  15. data/doc/api/DXOpal.html +129 -0
  16. data/doc/api/DXOpal/Font.html +485 -0
  17. data/doc/api/DXOpal/Image.html +2533 -0
  18. data/doc/api/DXOpal/Input.html +1086 -0
  19. data/doc/api/DXOpal/Input/MouseCodes.html +146 -0
  20. data/doc/api/DXOpal/RemoteResource.html +641 -0
  21. data/doc/api/DXOpal/Sound.html +568 -0
  22. data/doc/api/DXOpal/SoundEffect.html +444 -0
  23. data/doc/api/DXOpal/SoundEffect/WaveTypes.html +130 -0
  24. data/doc/api/DXOpal/Sprite.html +1419 -0
  25. data/doc/api/DXOpal/Window.html +1915 -0
  26. data/doc/api/_index.html +228 -0
  27. data/doc/api/class_list.html +51 -0
  28. data/doc/api/css/common.css +1 -0
  29. data/doc/api/css/full_list.css +58 -0
  30. data/doc/api/css/style.css +492 -0
  31. data/doc/api/file.CHANGELOG.html +162 -0
  32. data/doc/api/file.README.html +124 -0
  33. data/doc/api/file_list.html +61 -0
  34. data/doc/api/frames.html +17 -0
  35. data/doc/api/index.html +124 -0
  36. data/doc/api/js/app.js +248 -0
  37. data/doc/api/js/full_list.js +216 -0
  38. data/doc/api/js/jquery.js +4 -0
  39. data/doc/api/method_list.html +939 -0
  40. data/doc/api/top-level-namespace.html +110 -0
  41. data/doc/en/index.html +93 -0
  42. data/doc/ja/index.html +92 -0
  43. data/dxopal.gemspec +29 -0
  44. data/exe/dxopal +44 -0
  45. data/index.html +56 -0
  46. data/opal/dxopal.rb +54 -0
  47. data/opal/dxopal/constants/colors.rb +16 -0
  48. data/opal/dxopal/font.rb +20 -0
  49. data/opal/dxopal/image.rb +301 -0
  50. data/opal/dxopal/input.rb +170 -0
  51. data/opal/dxopal/input/key_codes.rb +168 -0
  52. data/opal/dxopal/remote_resource.rb +65 -0
  53. data/opal/dxopal/sound.rb +53 -0
  54. data/opal/dxopal/sound_effect.rb +84 -0
  55. data/opal/dxopal/sprite.rb +94 -0
  56. data/opal/dxopal/sprite/collision_area.rb +288 -0
  57. data/opal/dxopal/sprite/collision_check.rb +106 -0
  58. data/opal/dxopal/sprite/collision_checker.rb +169 -0
  59. data/opal/dxopal/sprite/physics.rb +82 -0
  60. data/opal/dxopal/version.rb +3 -0
  61. data/opal/dxopal/window.rb +173 -0
  62. data/template/index.html +13 -0
  63. data/template/main.rb +9 -0
  64. metadata +191 -0
@@ -0,0 +1,162 @@
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
+ File: CHANGELOG
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "CHANGELOG";
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="file_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> &raquo;
40
+ <span class="title">File: CHANGELOG</span>
41
+
42
+ </div>
43
+
44
+ <div id="search">
45
+
46
+ <a class="full_list_link" id="class_list_link"
47
+ href="class_list.html">
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
54
+ </a>
55
+
56
+ </div>
57
+ <div class="clear"></div>
58
+ </div>
59
+
60
+ <div id="content"><div id='filecontents'><h2>v0.4.0 ()</h2>
61
+
62
+ <ul>
63
+ <li>new: Sprite.check</li>
64
+ <li>new: Window.bgcolor</li>
65
+ <li>new: Input.mouse_down?, mouse_push?, mouse_release?</li>
66
+ <li>new: Matter.js support (experimental)</li>
67
+ <li>fix: Image transparency was ignored</li>
68
+ <li>fix: Sprite.clean was broken</li>
69
+ </ul>
70
+
71
+ <h2>v0.3.0 (2017-08-03)</h2>
72
+
73
+ <ul>
74
+ <li>new: Window.real_fps</li>
75
+ <li>new: Some more drawing methods</li>
76
+ <li>new: SoundEffect class</li>
77
+ <li>improve: Better fps stabillity (use requestAnimationFrame)</li>
78
+ </ul>
79
+
80
+ <h2>v0.2.0 (2017-06-02)</h2>
81
+
82
+ <ul>
83
+ <li>new: Add example (apple_catcher)</li>
84
+ </ul>
85
+
86
+ <h3>Breaking Change: resource loading</h3>
87
+
88
+ <p>Image.load and Sound.new are removed. They look like a synchronous API
89
+ but actually were not. It was fun to emulate DXRuby APIs with JS Promise,
90
+ but I found it
91
+ very confusing while implementing the AppleCatcher example.</p>
92
+
93
+ <p>Since v0.2, resource loading look like this.</p>
94
+
95
+ <pre class="code rb"><code class="rb">Image.register(:player, &#39;images/player.png&#39;)
96
+ Sound.register(:game_over, &#39;sounds/game_over.wav&#39;)
97
+
98
+ Window.load_resources do
99
+ Window.loop do
100
+ # ... Window.draw(0, 0, Image[:player]) ...
101
+
102
+ # ... Sound[:game_over].play ...
103
+ end
104
+ end
105
+ </code></pre>
106
+
107
+ <h2>v0.1.2 (2017-05-01)</h2>
108
+
109
+ <ul>
110
+ <li>new: Window.pause, .resume</li>
111
+ <li>new: Window.draw_box_fill</li>
112
+ <li>new: Sprite.update, Sprite.clean</li>
113
+ </ul>
114
+
115
+ <h2>v0.1.1 (2017-04-30)</h2>
116
+
117
+ <ul>
118
+ <li>fix: Image#draw now respects alpha channel</li>
119
+ <li>fix: Vanished sprites have no collision</li>
120
+ <li>new: Image#slice</li>
121
+ </ul>
122
+
123
+ <h2>v0.1.0 (2017-04-24)</h2>
124
+
125
+ <ul>
126
+ <li>new: Sprite.new, collision detection</li>
127
+ <li>new: Input.mouse_pos_x, mouse_pos_y</li>
128
+ </ul>
129
+
130
+ <h2>v0.0.3 (2017-04-23)</h2>
131
+
132
+ <ul>
133
+ <li>fix: Input.key_down? return true after key is released</li>
134
+ <li>new: color constants</li>
135
+ <li>new: Image.new, Image#circle, etc.</li>
136
+ <li>new: console</li>
137
+ <li>refactor: Split source file</li>
138
+ </ul>
139
+
140
+ <h2>v0.0.2 (2017-04-22)</h2>
141
+
142
+ <ul>
143
+ <li>Moved demos to yhara/dxopal-game</li>
144
+ <li>Now ruby is not mandatory to make games with DXOpal</li>
145
+ </ul>
146
+
147
+ <h2>v0.0.1 (2017-04-19)</h2>
148
+
149
+ <ul>
150
+ <li>Gemified (not pushed to rubygems.org yet)</li>
151
+ </ul>
152
+ </div></div>
153
+
154
+ <div id="footer">
155
+ Generated on Tue Oct 17 13:56:27 2017 by
156
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
157
+ 0.9.9 (ruby-2.4.2).
158
+ </div>
159
+
160
+ </div>
161
+ </body>
162
+ </html>
@@ -0,0 +1,124 @@
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
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "README";
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="file_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> &raquo;
40
+ <span class="title">File: README</span>
41
+
42
+ </div>
43
+
44
+ <div id="search">
45
+
46
+ <a class="full_list_link" id="class_list_link"
47
+ href="class_list.html">
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
54
+ </a>
55
+
56
+ </div>
57
+ <div class="clear"></div>
58
+ </div>
59
+
60
+ <div id="content"><div id='filecontents'><h1>DXOpal</h1>
61
+
62
+ <p>Game development framework for <a href="http://opalrb.org/">Opal</a>,
63
+ API compatible to <a href="http://dxruby.osdn.jp/">DXRuby</a></p>
64
+
65
+ <h2>Demo</h2>
66
+
67
+ <p><a href="https://yhara.github.io/dxopal/">https://yhara.github.io/dxopal/</a></p>
68
+
69
+ <h2>Status</h2>
70
+
71
+ <p>Early-alpha</p>
72
+
73
+ <h2>How to create a game</h2>
74
+
75
+ <p>See <a href="https://github.com/yhara/dxopal-game">dxopal-game</a></p>
76
+
77
+ <h2>API difference</h2>
78
+
79
+ <h3>Loading resources</h3>
80
+
81
+ <p>Because of the async nature of JavaScript, <code>Image.load</code> and <code>Sound.new</code>
82
+ are changed to <code>Image.register</code>, <code>Sound.register</code> and <code>Window.load_resources</code>.</p>
83
+
84
+ <p><code>Window.load_resources</code> tries to load all the resouces declared by <code>register</code>
85
+ and call the block when all of them are loaded.</p>
86
+
87
+ <pre class="code rb"><code class="rb">Image.register(:player, &#39;images/player.png&#39;)
88
+ Sound.register(:game_over, &#39;sounds/game_over.wav&#39;)
89
+
90
+ Window.load_resources do
91
+ Window.loop do
92
+ # ... Window.draw(0, 0, Image[:player]) ...
93
+
94
+ # ... Sound[:game_over].play ...
95
+ end
96
+ end
97
+ </code></pre>
98
+
99
+ <h2>License</h2>
100
+
101
+ <p>MIT (including images and sounds under examples/)</p>
102
+
103
+ <h2>Acknowledgements</h2>
104
+
105
+ <ul>
106
+ <li><a href="http://opalrb.org/">Opal</a></li>
107
+ <li><a href="http://dxruby.osdn.jp/">DXRuby</a></li>
108
+ <li><a href="http://www.bfxr.net/">Bxfr</a> examples/apple_catcher/sounds/Explosion2.wav is made by this</li>
109
+ </ul>
110
+
111
+ <h2>Contact</h2>
112
+
113
+ <p><a href="https://github.com/yhara/dxopal">https://github.com/yhara/dxopal</a></p>
114
+ </div></div>
115
+
116
+ <div id="footer">
117
+ Generated on Tue Oct 17 13:56:27 2017 by
118
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
+ 0.9.9 (ruby-2.4.2).
120
+ </div>
121
+
122
+ </div>
123
+ </body>
124
+ </html>
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta charset="utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <title>File List</title>
19
+ <base id="base_target" target="_parent" />
20
+ </head>
21
+ <body>
22
+ <div id="content">
23
+ <div class="fixed_header">
24
+ <h1 id="full_list_header">File List</h1>
25
+ <div id="full_list_nav">
26
+
27
+ <span><a target="_self" href="class_list.html">
28
+ Classes
29
+ </a></span>
30
+
31
+ <span><a target="_self" href="method_list.html">
32
+ Methods
33
+ </a></span>
34
+
35
+ <span><a target="_self" href="file_list.html">
36
+ Files
37
+ </a></span>
38
+
39
+ </div>
40
+
41
+ <div id="search">Search: <input type="text" /></div>
42
+ </div>
43
+
44
+ <ul id="full_list" class="file">
45
+
46
+
47
+ <li id="object_README" class="odd">
48
+ <div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
49
+ </li>
50
+
51
+
52
+ <li id="object_CHANGELOG" class="even">
53
+ <div class="item"><span class="object_link"><a href="file.CHANGELOG.html" title="CHANGELOG">CHANGELOG</a></span></div>
54
+ </li>
55
+
56
+
57
+
58
+ </ul>
59
+ </div>
60
+ </body>
61
+ </html>
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Documentation by YARD 0.9.9</title>
6
+ </head>
7
+ <script type="text/javascript" charset="utf-8">
8
+ var match = unescape(window.location.hash).match(/^#!(.+)/);
9
+ var name = match ? match[1] : 'index.html';
10
+ name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
11
+ window.top.location = name;
12
+ </script>
13
+ <noscript>
14
+ <h1>Oops!</h1>
15
+ <h2>YARD requires JavaScript!</h2>
16
+ </noscript>
17
+ </html>
@@ -0,0 +1,124 @@
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
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "README";
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> &raquo;
40
+ <span class="title">File: README</span>
41
+
42
+ </div>
43
+
44
+ <div id="search">
45
+
46
+ <a class="full_list_link" id="class_list_link"
47
+ href="class_list.html">
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
54
+ </a>
55
+
56
+ </div>
57
+ <div class="clear"></div>
58
+ </div>
59
+
60
+ <div id="content"><div id='filecontents'><h1>DXOpal</h1>
61
+
62
+ <p>Game development framework for <a href="http://opalrb.org/">Opal</a>,
63
+ API compatible to <a href="http://dxruby.osdn.jp/">DXRuby</a></p>
64
+
65
+ <h2>Demo</h2>
66
+
67
+ <p><a href="https://yhara.github.io/dxopal/">https://yhara.github.io/dxopal/</a></p>
68
+
69
+ <h2>Status</h2>
70
+
71
+ <p>Early-alpha</p>
72
+
73
+ <h2>How to create a game</h2>
74
+
75
+ <p>See <a href="https://github.com/yhara/dxopal-game">dxopal-game</a></p>
76
+
77
+ <h2>API difference</h2>
78
+
79
+ <h3>Loading resources</h3>
80
+
81
+ <p>Because of the async nature of JavaScript, <code>Image.load</code> and <code>Sound.new</code>
82
+ are changed to <code>Image.register</code>, <code>Sound.register</code> and <code>Window.load_resources</code>.</p>
83
+
84
+ <p><code>Window.load_resources</code> tries to load all the resouces declared by <code>register</code>
85
+ and call the block when all of them are loaded.</p>
86
+
87
+ <pre class="code rb"><code class="rb">Image.register(:player, &#39;images/player.png&#39;)
88
+ Sound.register(:game_over, &#39;sounds/game_over.wav&#39;)
89
+
90
+ Window.load_resources do
91
+ Window.loop do
92
+ # ... Window.draw(0, 0, Image[:player]) ...
93
+
94
+ # ... Sound[:game_over].play ...
95
+ end
96
+ end
97
+ </code></pre>
98
+
99
+ <h2>License</h2>
100
+
101
+ <p>MIT (including images and sounds under examples/)</p>
102
+
103
+ <h2>Acknowledgements</h2>
104
+
105
+ <ul>
106
+ <li><a href="http://opalrb.org/">Opal</a></li>
107
+ <li><a href="http://dxruby.osdn.jp/">DXRuby</a></li>
108
+ <li><a href="http://www.bfxr.net/">Bxfr</a> examples/apple_catcher/sounds/Explosion2.wav is made by this</li>
109
+ </ul>
110
+
111
+ <h2>Contact</h2>
112
+
113
+ <p><a href="https://github.com/yhara/dxopal">https://github.com/yhara/dxopal</a></p>
114
+ </div></div>
115
+
116
+ <div id="footer">
117
+ Generated on Tue Oct 17 13:56:27 2017 by
118
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
+ 0.9.9 (ruby-2.4.2).
120
+ </div>
121
+
122
+ </div>
123
+ </body>
124
+ </html>