プロキシーライクなゲームを作成するjavascript「Blocks.js」
2007
12/23
ブロック崩しの進化版のような「プロキシー(?)」というゲームがあります。
それをjavascriptで作成したPrototype/Scriptaculous Version of Same Gameです。

使用方法
Prototype/Scriptaculous Version of Same Gameからsound.jsとblocks.jsを、script.aculo.usからscript.aculo.usの1.8.0をダウンロードします。
*prototypeは同梱の1.6を使用してください。
<script src="http://yourdomain/prototype" type="text/javascript"></script>
<script src="http://yourdomain/scriptaculous18/effects.js" type="text/javascript"></script>
<script src="http://yourdomain/sound.js" type="text/javascript"></script>
<script src="http://yourdomain/blocks.js" type="text/javascript"></script>
<script type="text/javascript">
var sameGame = null;
Event.observe(window, "load", function(event){ sameGame = new SameGame('blocks') });
</script>
<link rel="stylesheet" href="game.css" style type="text/css" media="screen">
上記のように書き込むとともにゲームを表示したい場所に以下を記述します。
<div id="game">
<div id="blocks" style="position: absolute; top: 15px; left: 15px; width: 300px; height: 300px;"></div>
<div id="new_game">
<a href="javascript:try{ sameGame.newGame(); }catch(e){ alert('Looks like we have an error.'); }">New Game</a>
</div>
<div id="score"> 0 </div>
<div id="hover_points"> 0 </div>
</div>
プロキシーライクなゲームを作成するjavascript「Blocks.js」サンプル
前の記事:Appleライクなサイトを作るためのJavaScript 19+1
次の記事:テキストを複製できなくするjavascript「jQuery Disable Text Select Plugin」
コメント投稿
プロキシーライクなゲームを作成するjavascript「Blocks.js」に関するコメントはまだありません。
ご遠慮なくコメントしてください。
この記事へのトラックバック:
トラックバック一覧

![[mootools]Moognify.js](http://www.skuare.net/test/mootools/win2.gif)
![[jQuery]Background-Position Animation](http://www.skuare.net/test/jQuery/backgroundposition.gif)
![[mootools]MooMonth](http://www.skuare.net/test/mootools/month.gif)