Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

git-svn-id: http://hotruby.googlecode.com/svn/trunk@30 4fb8041d-b042-…

…0410-9571-f50be27af959
  • Loading branch information...
commit a3a759187dd8d3c14cc6d518e372b36b031202f2 1 parent 675ff5e
yukoba@accelart.jp authored

Showing 2 changed files with 29 additions and 29 deletions. Show diff stats Hide diff stats

  1. +5 4 web/index.html
  2. +24 25 web/test-web/pinball.html
9 web/index.html
... ... @@ -1,13 +1,13 @@
1 1 <html>
2 2 <head>
3   - <title>HotRuby - Ruby on JavaScript</title>
  3 + <title>HotRuby - Ruby on JavaScript and Flash</title>
4 4 </head>
5 5 <body>
6   - <h1>HotRuby - Ruby on JavaScript</h1>
  6 + <h1>HotRuby - Ruby on JavaScript and Flash</h1>
7 7
8 8 <p>
9   - HotRuby is Ruby on JavaScript. <br />
10   - HotRuby runs opcode, compiled by YARV(Yet Another Ruby VM) on Ruby. To be precise, HotRuby is Ruby VM on JavaScript. <br />
  9 + HotRuby is Ruby on JavaScript and Flash. <br />
  10 + HotRuby runs opcode, compiled by YARV(Yet Another Ruby VM) on Ruby. To be precise, HotRuby is Ruby VM on JavaScript and Flash. <br />
11 11 Most of the grammars are implemented. However, exceptions are not implemented. Most of the build-in functions and build-in classes are not implemented. <br />
12 12 </p>
13 13
@@ -59,6 +59,7 @@
59 59 <ul>
60 60 <li><a href="http://code.google.com/p/hotruby/source">Google Code</a></li>
61 61 <li><a href="jsdoc">JSDoc</a></li>
  62 + <li><a href="http://d.hatena.ne.jp/yukoba/searchdiary?word=%2a%5bHotRuby%5d">Japanese Blog</a></li>
62 63 </ul>
63 64 </div>
64 65
49 web/test-web/pinball.html
@@ -6,7 +6,7 @@
6 6 <script type="text/javascript" src="../js/ext-base.js"></script>
7 7 </head>
8 8 <body onload="prettyPrint();">
9   - <h1>Pinball - HotRuby(Ruby on Flash)</h1>
  9 + <h1>Pinball - HotRuby - Ruby on Flash</h1>
10 10 <div>
11 11 <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
12 12 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
@@ -31,7 +31,7 @@
31 31 $n.import "flash.text.*"
32 32 $n.import "General.*"
33 33 $n.import "TestBed.*"
34   -
  34 +
35 35 class Pinball
36 36 def initialize
37 37 add_fps_counter
@@ -41,7 +41,7 @@
41 41 init_world
42 42 add_listener
43 43 end
44   -
  44 +
45 45 def add_listener
46 46 listener = Proc.new{|evt|
47 47 # clear for rendering
@@ -60,7 +60,7 @@
60 60 # add event listener
61 61 $n._root.addEventListener $n.Event.ENTER_FRAME, listener, false, 0, true
62 62 end
63   -
  63 +
64 64 def init_world
65 65 @world = $n.Test.new
66 66
@@ -72,16 +72,16 @@
72 72
73 73 wall_l = add_wall 145, 285, 40, 5, 0.2, 1.5
74 74 wall_r = add_wall 395, 285, 40, 5, 0.8, 1.5
75   -
  75 +
76 76 add_flap 207, 310, 44, 5, 0, wall_l, 1
77 77 add_flap 333, 310, 44, 5, 0, wall_r, -1
78   -
  78 +
79 79 add_super_ball 160, 200, 10
80 80 add_super_ball 210, 100, 10
81 81 add_super_ball 260, 150, 10
82 82 add_super_ball 310, 200, 10
83 83 add_super_ball 360, 120, 10
84   -
  84 +
85 85 5.times {
86 86 add_box
87 87 }
@@ -90,7 +90,7 @@
90 90 def add_wall(x, y, w, h, rotation, restituion)
91 91 boxDef = $n.b2BoxDef.new
92 92 bodyDef = $n.b2BodyDef.new
93   -
  93 +
94 94 boxDef.density = 0.0
95 95 boxDef.friction = 0.4
96 96 boxDef.restitution = restituion
@@ -100,14 +100,14 @@
100 100 bodyDef.position.Set x / physScale, y / physScale
101 101 bodyDef.rotation = rotation * $n.Math.PI
102 102 bodyDef.AddShape boxDef
103   -
  103 +
104 104 @world.m_world.CreateBody bodyDef
105 105 end
106 106
107 107 def add_flap(x, y, w, h, rotation, attach_wall, lr)
108 108 boxDef = $n.b2BoxDef.new
109 109 bodyDef = $n.b2BodyDef.new
110   -
  110 +
111 111 boxDef.density = 2.0
112 112 boxDef.friction = 0.4
113 113 boxDef.restitution = 0.3
@@ -117,9 +117,9 @@
117 117 bodyDef.position.Set x / physScale, y / physScale
118 118 bodyDef.rotation = rotation * $n.Math.PI
119 119 bodyDef.AddShape boxDef
120   -
  120 +
121 121 flap = @world.m_world.CreateBody bodyDef
122   -
  122 +
123 123 # Joint
124 124 jd = $n.b2RevoluteJointDef.new
125 125 jd.enableLimit = true
@@ -139,7 +139,7 @@
139 139 def add_super_ball(x, y, radius)
140 140 boxDef = $n.b2CircleDef.new
141 141 bodyDef = $n.b2BodyDef.new
142   -
  142 +
143 143 boxDef.density = 0.0
144 144 boxDef.friction = 0.3
145 145 boxDef.restitution = 2.0
@@ -149,14 +149,14 @@
149 149 bodyDef.position.Set x / physScale, y / physScale
150 150 bodyDef.rotation = $n.Math.random * $n.Math.PI
151 151 bodyDef.AddShape boxDef
152   -
  152 +
153 153 @world.m_world.CreateBody bodyDef
154 154 end
155   -
  155 +
156 156 def add_box
157 157 boxDef = $n.b2BoxDef.new
158 158 bodyDef = $n.b2BodyDef.new
159   -
  159 +
160 160 boxDef.density = 1.0
161 161 boxDef.friction = 0.3
162 162 boxDef.restitution = 0.1
@@ -171,7 +171,7 @@
171 171 bodyDef.position.Set x / physScale, y / physScale
172 172 bodyDef.rotation = $n.Math.random * $n.Math.PI
173 173 bodyDef.AddShape boxDef
174   -
  174 +
175 175 @world.m_world.CreateBody bodyDef
176 176 end
177 177
@@ -189,17 +189,17 @@
189 189 @sprite = $n.Sprite.new
190 190 $n.Main.m_sprite = @sprite
191 191 $n._root.addChild @sprite
192   -
  192 +
193 193 @input = $n.Input.new @sprite
194 194 end
195   -
  195 +
196 196 #Instructions Text
197 197 def add_instructions_text
198 198 instructions_text = $n.TextField.new
199   -
  199 +
200 200 instructions_text_format = $n.TextFormat.new "Arial", 16, 0xffffff, false, false, false
201 201 instructions_text_format.align = $n.TextFormatAlign.RIGHT
202   -
  202 +
203 203 instructions_text.defaultTextFormat = instructions_text_format
204 204 instructions_text.x = 140
205 205 instructions_text.y = 4.5
@@ -213,7 +213,7 @@
213 213 def add_about_text
214 214 aboutTextFormat = $n.TextFormat.new "Arial", 16, 0x00CCFF, true, false, false
215 215 aboutTextFormat.align = $n.TextFormatAlign.RIGHT
216   -
  216 +
217 217 about_text = $n.TextField.new
218 218 about_text.defaultTextFormat = aboutTextFormat
219 219 about_text.x = 194
@@ -223,9 +223,8 @@
223 223 $n.Main.m_aboutText = about_text
224 224 $n._root.addChild about_text
225 225 end
226   -
  226 +
227 227 # Make a big invisible box to cover the stage so that input focus doesn't change when mousing over the textfields
228   - # (Please let me know if there's a better way to solve this problem) (:
229 228 def add_input_fix_sprite
230 229 inputFixSprite = $n.Sprite.new
231 230 inputFixSprite.graphics.lineStyle 0,0,0
@@ -238,7 +237,7 @@
238 237 $n._root.addChild inputFixSprite
239 238 end
240 239 end
241   -
  240 +
242 241 Pinball.new
243 242 </pre></div>
244 243

0 comments on commit a3a7591

Please sign in to comment.
Something went wrong with that request. Please try again.