Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 with 29 additions and 29 deletions.
  1. +5 −4 web/index.html
  2. +24 −25 web/test-web/pinball.html
9 web/index.html
View
@@ -1,13 +1,13 @@
<html>
<head>
- <title>HotRuby - Ruby on JavaScript</title>
+ <title>HotRuby - Ruby on JavaScript and Flash</title>
</head>
<body>
- <h1>HotRuby - Ruby on JavaScript</h1>
+ <h1>HotRuby - Ruby on JavaScript and Flash</h1>
<p>
- HotRuby is Ruby on JavaScript. <br />
- HotRuby runs opcode, compiled by YARV(Yet Another Ruby VM) on Ruby. To be precise, HotRuby is Ruby VM on JavaScript. <br />
+ HotRuby is Ruby on JavaScript and Flash. <br />
+ HotRuby runs opcode, compiled by YARV(Yet Another Ruby VM) on Ruby. To be precise, HotRuby is Ruby VM on JavaScript and Flash. <br />
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 />
</p>
@@ -59,6 +59,7 @@
<ul>
<li><a href="http://code.google.com/p/hotruby/source">Google Code</a></li>
<li><a href="jsdoc">JSDoc</a></li>
+ <li><a href="http://d.hatena.ne.jp/yukoba/searchdiary?word=%2a%5bHotRuby%5d">Japanese Blog</a></li>
</ul>
</div>
49 web/test-web/pinball.html
View
@@ -6,7 +6,7 @@
<script type="text/javascript" src="../js/ext-base.js"></script>
</head>
<body onload="prettyPrint();">
- <h1>Pinball - HotRuby(Ruby on Flash)</h1>
+ <h1>Pinball - HotRuby - Ruby on Flash</h1>
<div>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
@@ -31,7 +31,7 @@
$n.import "flash.text.*"
$n.import "General.*"
$n.import "TestBed.*"
-
+
class Pinball
def initialize
add_fps_counter
@@ -41,7 +41,7 @@
init_world
add_listener
end
-
+
def add_listener
listener = Proc.new{|evt|
# clear for rendering
@@ -60,7 +60,7 @@
# add event listener
$n._root.addEventListener $n.Event.ENTER_FRAME, listener, false, 0, true
end
-
+
def init_world
@world = $n.Test.new
@@ -72,16 +72,16 @@
wall_l = add_wall 145, 285, 40, 5, 0.2, 1.5
wall_r = add_wall 395, 285, 40, 5, 0.8, 1.5
-
+
add_flap 207, 310, 44, 5, 0, wall_l, 1
add_flap 333, 310, 44, 5, 0, wall_r, -1
-
+
add_super_ball 160, 200, 10
add_super_ball 210, 100, 10
add_super_ball 260, 150, 10
add_super_ball 310, 200, 10
add_super_ball 360, 120, 10
-
+
5.times {
add_box
}
@@ -90,7 +90,7 @@
def add_wall(x, y, w, h, rotation, restituion)
boxDef = $n.b2BoxDef.new
bodyDef = $n.b2BodyDef.new
-
+
boxDef.density = 0.0
boxDef.friction = 0.4
boxDef.restitution = restituion
@@ -100,14 +100,14 @@
bodyDef.position.Set x / physScale, y / physScale
bodyDef.rotation = rotation * $n.Math.PI
bodyDef.AddShape boxDef
-
+
@world.m_world.CreateBody bodyDef
end
def add_flap(x, y, w, h, rotation, attach_wall, lr)
boxDef = $n.b2BoxDef.new
bodyDef = $n.b2BodyDef.new
-
+
boxDef.density = 2.0
boxDef.friction = 0.4
boxDef.restitution = 0.3
@@ -117,9 +117,9 @@
bodyDef.position.Set x / physScale, y / physScale
bodyDef.rotation = rotation * $n.Math.PI
bodyDef.AddShape boxDef
-
+
flap = @world.m_world.CreateBody bodyDef
-
+
# Joint
jd = $n.b2RevoluteJointDef.new
jd.enableLimit = true
@@ -139,7 +139,7 @@
def add_super_ball(x, y, radius)
boxDef = $n.b2CircleDef.new
bodyDef = $n.b2BodyDef.new
-
+
boxDef.density = 0.0
boxDef.friction = 0.3
boxDef.restitution = 2.0
@@ -149,14 +149,14 @@
bodyDef.position.Set x / physScale, y / physScale
bodyDef.rotation = $n.Math.random * $n.Math.PI
bodyDef.AddShape boxDef
-
+
@world.m_world.CreateBody bodyDef
end
-
+
def add_box
boxDef = $n.b2BoxDef.new
bodyDef = $n.b2BodyDef.new
-
+
boxDef.density = 1.0
boxDef.friction = 0.3
boxDef.restitution = 0.1
@@ -171,7 +171,7 @@
bodyDef.position.Set x / physScale, y / physScale
bodyDef.rotation = $n.Math.random * $n.Math.PI
bodyDef.AddShape boxDef
-
+
@world.m_world.CreateBody bodyDef
end
@@ -189,17 +189,17 @@
@sprite = $n.Sprite.new
$n.Main.m_sprite = @sprite
$n._root.addChild @sprite
-
+
@input = $n.Input.new @sprite
end
-
+
#Instructions Text
def add_instructions_text
instructions_text = $n.TextField.new
-
+
instructions_text_format = $n.TextFormat.new "Arial", 16, 0xffffff, false, false, false
instructions_text_format.align = $n.TextFormatAlign.RIGHT
-
+
instructions_text.defaultTextFormat = instructions_text_format
instructions_text.x = 140
instructions_text.y = 4.5
@@ -213,7 +213,7 @@
def add_about_text
aboutTextFormat = $n.TextFormat.new "Arial", 16, 0x00CCFF, true, false, false
aboutTextFormat.align = $n.TextFormatAlign.RIGHT
-
+
about_text = $n.TextField.new
about_text.defaultTextFormat = aboutTextFormat
about_text.x = 194
@@ -223,9 +223,8 @@
$n.Main.m_aboutText = about_text
$n._root.addChild about_text
end
-
+
# Make a big invisible box to cover the stage so that input focus doesn't change when mousing over the textfields
- # (Please let me know if there's a better way to solve this problem) (:
def add_input_fix_sprite
inputFixSprite = $n.Sprite.new
inputFixSprite.graphics.lineStyle 0,0,0
@@ -238,7 +237,7 @@
$n._root.addChild inputFixSprite
end
end
-
+
Pinball.new
</pre></div>
Please sign in to comment.
Something went wrong with that request. Please try again.