catch.jp-wiki
¥×¥í¥°¥é¥ß¥ó¥°
±Ñ¸ì³Ø½¬
ÍúÎò
¸¡º÷
Dropdown
°ìÍ÷
enchant.js
¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤·¤ÆºîÀ®
³«»Ï¹Ô:
[[Programing]]
¤³¤³¤Ï¡¢enchant.js¤ò¤Ï¤¸¤á¤ë¤È¤¤ËɬÍפʡ¢¤´¤¯¤´¤¯´ðËÜŪ...
enchant.js¤ËÉÕ°¤Î¥µ¥ó¥×¥ë¤Î¥¢¥¯¥·¥ç¥ó¥²¡¼¥à(\examples\ac...
enchant.js¤Ï¡¢¥²¡¼¥à¥×¥í¥°¥é¥à¤òºî¤ë¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¥×¥í...
HTML5¤ÈJavascript¤È¤¤¤¦µ»½Ñ¤Çºî¤é¤ì¤Æ¤¤¤Æ¡¢¥Ñ¥½¥³¥ó¤À¤±¤¸...
¤³¤³¤Ç¤Ï¡¢¾¯¤·¤º¤Ä¥³¡¼¥É¤òÊ£»¨¤Ë¤·¤Æ¤¤¤Ã¤Æ¡¢¥¯¥Þ¤¬Áö¤ê²ó...
-[[9leap : 30Éᢥê¥ó¥´½¸¤á¥²¡¼¥à by y_catch - ¤É¤³¤Ç¤âÍ·...
-30Éô֤ǡ¢¤Ç¤¤ë¤À¤±¤¿¤¯¤µ¤ó¥ê¥ó¥´¤ò½¸¤á¤Æ¤¯¤À¤µ¤¤¡£
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-º¸²¼¤Î½½»ú¥¨¥ê¥¢¤ò»È¤¦¤È¡¢¥Þ¥¦¥¹¥¯¥ê¥Ã¥¯(¥Ñ¥½¥³¥ó)¡¢¥¿¥Ã...
¤â¤¦¾¯¤·¥²¡¼¥à¤é¤·¤¯¤·¤¿¡£
-[[9leap : 30Éᢥê¥ó¥´½¸¤á¥²¡¼¥àPart2:http://9leap.net/g...
#ref(1176_140.gif)
#contents
*¥À¥¦¥ó¥í¡¼¥É [#yc6b9b9f]
-[[enchant.js - HTML5 + JavaScript Game Engine:http://enc...
*ɬÍפʥե¡¥¤¥ë [#b8f4e08f]
enchant.js¤«¤é¡¢¼¡¤Î¥Õ¥¡¥¤¥ë¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
¥¯¥Þ²èÁü(bear.gif)¤Ï¡¢²þÎɤ·¤Æ¤¤¤Þ¤¹¡£
- enchant.js¡§enchant.jsËÜÂÎ
- game.js¡§¥²¡¼¥à¤Î¥á¥¤¥ó¥×¥í¥°¥é¥à
- index.html¡§¥á¥¤¥ó¥×¥í¥°¥é¥à¤ò¸Æ¤Ó½Ð¤¹HTML¥Õ¥¡¥¤¥ë¡£¤³...
- bear.gif:²èÁü¥Õ¥¡¥¤¥ë
#ref(bear.gif)
* index.html [#nde0ff97]
¥²¡¼¥à¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ index.html¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¡£¤³¤³¤«...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-widt...
<meta name="apple-mobile-web-app-capable" conten...
<meta name="apple-mobile-web-app-status-bar-styl...
<title>Sample Game</title>
<script type="text/javascript" src="enchant.js">...
<script type="text/javascript" src="game.js"></s...
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
</body>
</html>
* game.js¤Î´ðËÜ¥³¡¼¥É [#b1f8a8b5]
¥²¡¼¥à¤Î¥á¥¤¥ó¥×¥í¥°¥é¥à¤Ç¤¢¤ëgame.js¤Î´ðËÜŪ¤Ê¹½À®¤ò½çÈÖ...
**²¿¤â¤·¤Ê¤¤¥³¡¼¥É [#z5168b76]
¤³¤ì¤¬¡¢´ðËÜ·Á¡£¤¤¤Á¤ª¤¦¡¢²èÁü¥Õ¥¡¥¤¥ë(bear.gif)¤òÆÉ¤ß¹þ...
²¼µ¤Î¥Æ¥¥¹¥È¤ògame.js¤È¤¤¤¦¥Æ¥¥¹¥È¥Õ¥¡¥¤¥ë¤È¤·¤ÆÊݸ¤¹...
enchant();
window.onload = function() {
var game = new Game(320, 320); //¥²¡¼¥à²èÌ̤òÀßÄê
game.preload('bear.gif'); //²èÁü¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ß
game.onload = function() {
//¡Ö{¡×¤È¡Ö}¡×¤Î´Ö¤Ë¡¢¥²¡¼¥à¤Îưºî¤òµ½Ò¤¹¤ë
}
game.start();
}
**²èÁü¤ò¤¿¤Àɽ¼¨¤¹¤ë [#qb76c8e5]
Á°½Ò¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤´¹¤¨¤Æ¡¢¥¹¥×¥é¥¤¥Èµ¡Ç½(Sprite)¤Ç²èÁü...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
game.rootScene.addChild(bear);
}
game.start();
}
**ɽ¼¨¤¹¤ë²èÁü¤òÊѤ¨¤ë [#p7e99849]
Ê£¿ô¤Î¥¤¥á¡¼¥¸¤ò»ý¤Ã¤Æ¤¤¤ë²èÁü¤Î¾ì¹ç¡¢¥¹¥×¥é¥¤¥È¤ÇÊ̤Υ¤...
¥¯¥Þ¤¬Ê⤤¤Æ¤¤¤ë¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Ê¤É¤Ë»È¤¨¤Þ¤¹(¤Þ¤ÀÊ⤤ޤ»...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
bear.frame = 1;
game.rootScene.addChild(bear);
}
game.start();
}
**ɽ¼¨°ÌÃÖ¤ò»ØÄê [#mb934d47]
¥¹¥×¥é¥¤¥È¤Î°ÌÃÖ¤ò»ØÄê
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
bear.x = 150;
bear.y = 150;
bear.frame = 1;
game.rootScene.addChild(bear);
}
game.start();
}
**¥¡¼ÆþÎϤDzèÁü¤òÀÚ¤êÂØ¤¨ [#s89a6625]
º¸±¦¤ÎÌð°õ¥¡¼¤ò²¡¤·¤Æ¡¢²èÁü¤òÀÚ¤êÂØ¤¨
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.x = 150;
bear.y = 150;
if(game.input.left) bear.frame = 1;
if(game.input.right) bear.frame = 2;
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó£± [#f6c15a11]
º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¤½¤Î¾ì¤ÇÁö¤ë
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.x = 150;
bear.y = 150;
if(game.input.right) {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
}
if(game.input.left) {
if(bear.frame == 4) {
bear.frame = 5;
} else {
bear.frame = 4;
}
}
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó£² [#v06aaf4f]
º¸±¦¤ÎÌð°õ¥¡¼¤ÇÁö¤ë¡£ÊɤÏ̵»ë¡£
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.y = 150;
if(game.input.right) {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
bear.x += 5;
}
if(game.input.left) {
if(bear.frame == 4) {
bear.frame = 5;
} else {
bear.frame = 4;
}
bear.x -= 5;
}
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó£³ [#r9bd2f81]
º¸±¦¤ÎÌð°õ¥¡¼¤ÇÁö¤ë¡£Êɤǻߤޤ롣
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.y = 150;
if(game.input.right) {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
if (bear.x < 300) {
bear.x += 5;
} else {
bear.x = 300;
}
}
if(game.input.left) {
if(bear.frame == 4) {
bear.frame = 5;
} else {
bear.frame = 4;
}
if (bear.x > 0) {
bear.x -= 5;
} else {
bear.x = 0;
}
}
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥µ¥ó¥×¥ë [#t3df58f2]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson1.lzh)
*ʸ»ú¤òɽ¼¨¤¹¤ë [#rff46cbc]
²èÌ̾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë¤Ë¤Ï¡¢¥é¥Ù¥ëµ¡Ç½(Label)¤ò»È¤¤¤Þ¤¹¡£
**²èÌ̾åÉô¤Ë¸ÇÄê¤Çʸ»ú¤òɽ¼¨¤¹¤ë [#u7bfd3f6]
¡ÖRunning Bear:¡×¤È¤¤¤¦Ê¸»ú¤òɽ¼¨¤¹¤ë
enchant();
window.onload = function() {
var game = new Game(320, 320);
var label = new Label("Running Bear:");
label.x = 0;
label.y = 0;
game.rootScene.addChild(label);
game.start();
}
**ʸ»ú¤ò½ñ¤´¹¤¨¤ë [#l4d79b5d]
¸ÇÄê¤Ç¤Ï¤Ê¤¯¡¢É½¼¨¤·¤Æ¤¤¤ëʸ»ú¤òÊѲ½¤µ¤»¤ë
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload("bear.gif");
var label = new Label("Running Bear:");
label.x = 0;
label.y = 0;
game.rootScene.addChild(label);
game.onload = function() {
var label_time = new Label();
label_time.x = 0;
label_time.y = 14;
label_time.addEventListener('enterframe', functi...
label_time.text = game.frame;
});
game.rootScene.addChild(label_time);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Èʸ»úɽ¼¨ [#x93a3f15]
¥¯¥Þ¤¬Áö¤ê¡¢·Ð²á»þ´Ö¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Î¥¹¥Ô¡¼¥É¤ò¡Ögame.fps = 15;¡×¤ÇÄ´À°¤·¤Æ¤¤...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload("bear.gif");
game.fps = 15;
var label = new Label("Running Bear:");
label.x = 0;
label.y = 0;
game.rootScene.addChild(label);
game.onload = function() {
//¥é¥Ù¥ë¤Çʸ»úɽ¼¨
var label_time = new Label();
label_time.x = 0;
label_time.y = 14;
¡¡¡¡¡¡¡¡label_time.addEventListener('enterframe',...
label_time.text = game.frame;
});
game.rootScene.addChild(label_time);
//¥¹¥×¥é¥¤¥È¤Ç¥¯¥Þɽ¼¨
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
bear.x += 5
if (bear.x > 300) {
bear.x = 0;
}
bear.y = 50;
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥µ¥ó¥×¥ë [#dcb86424]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-¥¯¥Þ¤¬Áö¤ê¡¢·Ð²á»þ´Ö¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson2.lzh)
*¸ú²Ì²»¤ò½Ð¤¹ [#o4cfc1f5]
¥²¡¼¥à¤Ë¸ú²Ì²»¤¬¤Ä¤¯¤È¡¢³Ú¤·¤µÇÜÁý¤Ç¤¹¡£
**¤È¤Ë¤«¤¯²»¤ò½Ð¤¹ [#hab3d314]
¥µ¥¦¥ó¥É¥Õ¥¡¥¤¥ë()¤òÆÉ¤ß¹þ¤ó¤Ç¡¢¤½¤ì¤ò¡Ö.play¡×¤ÇºÆÀ¸¤·¤Þ...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('jump.wav');
game.onload = function() {
var sound = game.assets['jump.wav'].play();
sound.play();
};
game.start();
};
**Áàºî¤Ë¤¢¤ï¤»¤Æ²»¤ò½Ð¤¹¡£ [#se2442cc]
²èÁüɽ¼¨¤Î¤È¤³¤í¤Ë¡¢ºÆÀ¸¤òÁȤ߹þ¤ß¤Þ¤¹¡£
¢¨¸ú²Ì²»¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤á¤Ê¤¯¤Æ¡¢²¿ÅÙ¤«¶ìÏ«¤·¤Þ¤·¤¿¡£ench...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('jump.wav', 'bear.gif');
game.onload = function() {
game.assets['jump.wav'].play();
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
if(game.input.right) {
var sound = game.assets['jump.wav'].clone();
sound.play();
}
});
game.rootScene.addChild(bear);
};
game.start();
};
**¥µ¥ó¥×¥ë [#m807a206]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-±¦Ìð°õ¥¡¼¤Ç²»¤¬½Ð¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson4.lzh)
*²èÁü¤òÉôÉʲ½¤¹¤ë [#h52552ae]
¥×¥í¥°¥é¥à¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÉôÉʤÎÁȤ߹ç¤ï¤»¤È¤·¤Æºî¤ë¤È¡¢ºî...
**¥¥ã¥é²èÁü¤òÉôÉʲ½ [#n27ba729]
Kuma¤È¤¤¤¦ÉôÉÊ(¥ª¥Ö¥¸¥§¥¯¥È)¤òÄêµÁ¡£¤½¤ì¤òplayer1¤Èplayer...
¤Ò¤È¤Ä¤ÎÀ߷׿Þ(Kuma)¤«¤é¡¢Ê£¿ô¤ÎÉôÉʤòºî¤ê½Ð¤·¤Æ¤¤¤Þ¤¹¡£...
enchant();
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
enchant.Sprite.call(this, 20, 30);
this.image = game.assets['bear.gif'];
this.x = x; this.y = y; this.frame = 0;
game.rootScene.addChild(this);
}
});
window.onload = function() {
game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
player1 = new Kuma(0, 0);
player1.frame = 1;
player2 = new Kuma(30, 0);
player2.frame = 2;
}
game.start();
}
**ÉôÉʲ½¤·¤¿²èÁü¤ò°Üư [#ia4fd2e6]
ÉôÉʤǤϡ¢ÉôÉʤÎÀ߷׿Þ¦¤Çưºî¤òÄêµÁ¤Ç¤¤Þ¤¹¡£¤³¤³¤Ç¤Ï¡¢K...
enchant();
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
enchant.Sprite.call(this, 20, 30);
this.image = game.assets['bear.gif'];
this.x = x; this.y = y; this.frame = 0;
game.rootScene.addChild(this);
},
move_right: function() {
this.x += 5;
},
move_left: function() {
this.x -= 5;
}
});
window.onload = function() {
game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
player = new Kuma(0, 0);
game.addEventListener('enterframe', function() {
if(game.input.right) {
player.move_right();
}
if(game.input.left) {
player.move_left();
}
});
}
game.start();
}
**ÉôÉʲ½¤·¤¿¥¥ã¥é¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó [#q6b81d2f]
¤¯¤Ã¤Ä¤±¤Æ¤ß¤¿¡£¥¡¼ÆþÎϤθ¡½Ð¤Ï¡¢ÉôÉʦ¤Ë°Üư¤·¤¿¡£¤³¤ì...
¥¥ã¥é¤Ïº¸±¦¥¡¼¤ÇÁà½Ä¤Ç¤¤ë¡£
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.KUMA_WIDTH = 20;
this.KUMA_HEIGHT = 30;
this.KUMA_Y = 50;
this.dir = 0; //¿Ê¹ÔÊý¸þ 0:±¦(right)¡¢1:º¸(left)
this.walk = 0; //Êâ¹Ô¥Ý¡¼¥º 0:Ää»ß 1:±¦Â 2:º¸Â
this.step = 5;
enchant.Sprite.call(this, this.KUMA_WIDTH, this.KUMA_H...
this.image = game.assets['bear.gif'];
this.x = x;
this.y = this.KUMA_Y;
this.frame = 0;
this.addEventListener('enterframe', function() {
if(game.input.right) {
this.move_right();
} else if(game.input.left) {
this.move_left();
} else {
this.move_stop();
}
this.change_frame();
});
game.rootScene.addChild(this);
},
move_right: function() {
this.dir = 0;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x < (SCREEN_WIDTH - this.KUMA_WIDTH)) {
this.x += this.step;
} else {
this.x = SCREEN_WIDTH - this.KUMA_WIDTH;
}
},
move_left: function() {
this.dir = 1;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x > 0) {
this.x -= this.step;
} else {
this.x = 0;
}
},
move_stop: function(){
if(this.walk !== 0) {
game.assets['jump.wav'].play();
}
this.walk = 0;
},
change_frame: function() {
this.frame = this.dir * 3 + this.walk;
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.preload('jump.wav', 'bear.gif');
game.onload = function() {
player = new Kuma(0, 0);
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson5.lzh)
*Ê£¿ô¤Î¥Ñ¡¼¥Ä¤òư¤«¤¹ [#f49c9150]
¥¢¥¯¥·¥ç¥ó¥²¡¼¥à¤Ç¤Ï¡¢Ê£¿ô¤ÎŨµ¡¤ä¥¿¡¼¥²¥Ã¥È¤¬Åо줷¤Þ¤¹...
**Ê£¿ô¤Î²èÁü¤òɽ¼¨¤¹¤ë [#he4e0e00]
¤Þ¤ºÊ£¿ô¤Î²èÁü¤òɽ¼¨¤¹¤ëÁ°¤Ë¡¢²èÁü¤ò¤Ò¤È¤Ä¤À¤±ÉôÉʲ½¤·¤Æ...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('icon0.gif');
game.onload = function() {
target = new Apple(100, 0);
}
game.start();
}
**Ê£¿ô¤Î²èÁü¤òư¤«¤¹ [#oda390f1]
¤³¤ì¤ò²þ¤¤·¤ÆÊ£¿ô¥¥ã¥é¤òư¤«¤»¤ë¤è¤¦¤Ë¤¹¤ë¤È¡¢¤³¤¦¤Ê¤ê...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('icon0.gif');
game.onload = function() {
targets = [];
game.rootScene.addEventListener('enterframe', function...
if((game.frame % 10) == 0){
var x = Math.floor(Math.random() * 300);
targets[game.frame] = new Apple(x, 0);
}
});
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson6-2.lzh)
¤³¤ì¤Ë¡¢Ì£Êý¥¥ã¥é¤òÉÕ¤±²Ã¤¨¤ë¤È¡¢¤½¤ì¤é¤·¤¯¤Ê¤Ã¤Æ¤¤Þ¤¹...
**¼«¥¥ã¥é(Áà½Ä¤Ç¤¤ë)¤ÈŨ¥¥ã¥é¤òƱ»þ¤Ëɽ¼¨¤¹¤ë [#v823b7...
º¸±¦¥¡¼¤ÇÁà½Ä¤Ç¤¤ë¼«¥¥ã¥é¤È¡¢Å¨¥¥ã¥é¤òƱ»þ¤Ëɽ¼¨¤¹¤ë...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
//Áà½Ä¤Ç¤¤ë¼«¥¥ã¥é
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.KUMA_WIDTH = 20;
this.KUMA_HEIGHT = 30;
this.KUMA_Y = 200;
this.dir = 0; //¿Ê¹ÔÊý¸þ 0:±¦(right)¡¢1:º¸(left)
this.walk = 0; //Êâ¹Ô¥Ý¡¼¥º 0:Ää»ß 1:±¦Â 2:º¸Â
this.step = 5;
enchant.Sprite.call(this, this.KUMA_WIDTH, this.KUMA_H...
this.image = game.assets['bear.gif'];
this.x = x;
this.y = this.KUMA_Y;
this.frame = 0;
this.addEventListener('enterframe', function() {
if(game.input.right) {
this.move_right();
} else if(game.input.left) {
this.move_left();
} else {
this.move_stop();
}
this.change_frame();
});
game.rootScene.addChild(this);
},
move_right: function() {
this.dir = 0;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x < (SCREEN_WIDTH - this.KUMA_WIDTH)) {
this.x += this.step;
} else {
this.x = SCREEN_WIDTH - this.KUMA_WIDTH;
}
},
move_left: function() {
this.dir = 1;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x > 0) {
this.x -= this.step;
} else {
this.x = 0;
}
},
move_stop: function(){
if(this.walk !== 0) {
game.assets['jump.wav'].play();
}
this.walk = 0;
},
change_frame: function() {
this.frame = this.dir * 3 + this.walk;
}
});
//Ê£¿ôɽ¼¨¤µ¤ì¤ëÁê¼ê¥¥ã¥é
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('bear.gif', 'icon0.gif', 'jump.wav');
game.onload = function() {
player = new Kuma(0, 0);
targets = [];
game.rootScene.addEventListener('enterframe', function...
if((game.frame % 10) == 0){
var x = Math.floor(Math.random() * 300);
targets[game.frame] = new Apple(x, 0);
}
});
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson6-3.lzh)
¤³¤ì¤ËÅö¤¿¤êȽÄê¤òÉÕ¤±²Ã¤¨¤ë¤È¡¢¥²¡¼¥à¤Ã¤Ý¤¯¤Ê¤ê¤Þ¤¹¤Í¡£
**Åö¤êȽÄê [#vf730204]
¼«¥¥ã¥é¤ÈÁê¼ê¥¥ã¥é¤¬ÀÜ¿¨¤·¤¿¤«¤É¤¦¤«¡¢Åö¤êȽÄê¤ò¹Ô¤¤¤Þ...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
score = 0;
//Áà½Ä¤Ç¤¤ë¼«¥¥ã¥é
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.KUMA_WIDTH = 20;
this.KUMA_HEIGHT = 30;
this.KUMA_Y = 200;
this.dir = 0; //¿Ê¹ÔÊý¸þ 0:±¦(right)¡¢1:º¸(left)
this.walk = 0; //Êâ¹Ô¥Ý¡¼¥º 0:Ää»ß 1:±¦Â 2:º¸Â
this.step = 5;
enchant.Sprite.call(this, this.KUMA_WIDTH, this.KUMA_H...
this.image = game.assets['bear.gif'];
this.x = x;
this.y = this.KUMA_Y;
this.frame = 0;
this.addEventListener('enterframe', function() {
if(game.input.right) {
this.move_right();
} else if(game.input.left) {
this.move_left();
} else {
this.move_stop();
}
this.change_frame();
});
game.rootScene.addChild(this);
},
move_right: function() {
this.dir = 0;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x < (SCREEN_WIDTH - this.KUMA_WIDTH)) {
this.x += this.step;
} else {
this.x = SCREEN_WIDTH - this.KUMA_WIDTH;
}
},
move_left: function() {
this.dir = 1;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x > 0) {
this.x -= this.step;
} else {
this.x = 0;
}
},
move_stop: function(){
this.walk = 0;
},
change_frame: function() {
this.frame = this.dir * 3 + this.walk;
}
});
//Ê£¿ôɽ¼¨¤µ¤ì¤ëÁê¼ê¥¥ã¥é
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
//Åö¤êȽÄê
if(this.intersect(player)){
this.remove();
game.assets['jump.wav'].play();
}
//²¼Ã¼¤ËÅþã
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('bear.gif', 'icon0.gif', 'jump.wav');
game.onload = function() {
player = new Kuma(0, 0);
targets = [];
game.rootScene.addEventListener('enterframe', function...
if((game.frame % 10) == 0){
var x = Math.floor(Math.random() * 300);
targets[game.frame] = new Apple(x, 0);
}
});
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson7.lzh)
*¥²¡¼¥àºîÀ®¤ËÊØÍø¤Ê¥×¥é¥°¥¤¥ó [#o7f33f99]
enchant.js¤Ï¡¢¥×¥é¥°¥¤¥ó(plugin)¤Çµ¡Ç½¤ò³ÈÄ¥¤Ç¤¤Þ¤¹¡£
¥²¡¼¥à¤òºî¤ë¤È¤¤â¡¢¥×¥é¥°¥¤¥ó¤ò³èÍѤ¹¤ë¤Èºî¶È¸úΨ¤¬¾å¤¬...
-[[plugin¡¿enchant.js - HTML5 + JavaScript Game Engine:ht...
²¼µ¤â»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
-[[enchant.js¤Çº£¤Þ¤Çºî¤Ã¤¿¥²¡¼¥à¤ò¡Ø9leap¡Ù»ÅÍͤˤ¹¤ëÊý...
**¥×¥é¥°¥¤¥ó¤Î»È¤¤Êý [#x47ae7cf]
¥×¥é¥°¥¤¥ó¤Ï¡¢enchant.js¤ÈƱ¤¸¥Õ¥©¥ë¥À¤«¡¢¤½¤Îľ²¼¤Îplugi...
enchant.js¤ò²òÅष¤¿¾ì¹ç¤Ï¡¢¸å¼Ô¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¤½¤ì¤«¤é¡¢¥×¥é¥°¥¤¥ó¤¬É¬ÍפȤ¹¤ë²èÁü¤òƱ¤¸¥Õ¥©¥ë¥À¤ËÍѰÕ...
-nineleap.enchant.js¤Î¾ì¹ç
--start.png
--end.png
--font.png
-ui.enchant.js¤Î¾ì¹ç
--apad.png
--pad.png
¤¢¤È¤Ï¡¢index.html¤Ë¥×¥é¥°¥¤¥ó¥Õ¥¡¥¤¥ë¤Îµ½Ò¤òÄɲä·¤Þ¤¹¡£
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-widt...
<meta name="apple-mobile-web-app-capable" conten...
<meta name="apple-mobile-web-app-status-bar-styl...
<title>enchant</title>
<script type="text/javascript" src="enchant.js">...
<script type="text/javascript" src="plugins/nine...
<script type="text/javascript" src="plugins/util...
<script type="text/javascript" src="plugins/ui.e...
<script type="text/javascript" src="game.js"></s...
<style type="text/css">
body {margin: 0;}
</style>
</head>
<body>
</body>
</html>
¾åµ¤Ç¤Ï¡¢10-11¹ÔÌܤÇplugins¥Õ¥©¥ë¥À¤Ë¤¢¤ë¥×¥é¥°¥¤¥ó¥Õ¥¡...
**¥¹¥¿¡¼¥È²èÌÌ [#g122127c]
nineleap.enchant.js¤òÆÉ¤ß¹þ¤à¤È¡¢¥²¡¼¥à¥¹¥¿¡¼¥È»þ¤Ë¼«Æ°Åª...
**½ªÎ»²èÌÌ [#h45a6768]
nineleap.enchant.js¤òÆÉ¤ß¹þ¤ß¡¢¥²¡¼¥à½ªÎ»¤¹¤Ù¤¤È¤³¤í¤Ë²¼...
game.end(game.score, "game end");
game.score¤Ï¡¢ÆÀÅÀ¤ò³ÊǼ¤·¤¿ÊÑ¿ô¡£
**¥¿¥¤¥àɽ¼¨ [#df53f786]
¥×¥í¥°¥é¥àËÜÂÎ(game.onload = function()¤Î¤È¤³¤í)¤Ë¡¢²¼µ...
timeLabel = new TimeLabel(8, 8);
game.rootScene.addChild(timeLabel);
²¼µ¤Î¤è¤¦¤Ë½ñ¤¯¤È¥«¥¦¥ó¥È¥À¥¦¥ó¡£
timeLabel = new TimeLabel(8, 8, "countdown");
timeLabel.time = 30;
game.rootScene.addChild(timeLabel);
ɽ¼¨¤¹¤ë¥é¥Ù¥ë¤òÊѹ¹¤¹¤ë¤Ë¤Ï
timeLabel.label = "LIFE:";
¸½ºß¤Î·Ð²á»þ´Ö¤ò¼è¤ê½Ð¤¹¤Ë¤Ï¡¢
A = timeLabel.label;
**¥¹¥³¥¢É½¼¨ [#w26baaee]
¥×¥í¥°¥é¥àËÜÂΤνé´ü²½Éôʬ(window.onload = function() )¤Ë...
game.score = 0; //ÆÀÅÀ¤Î½é´ü²½
¥×¥í¥°¥é¥àËÜÂÎ(game.onload = function()¤Î¤È¤³¤í)¤Ë¡¢²¼µ...
scoreLabel = new ScoreLabel(40, 8);
game.rootScene.addChild(scoreLabel);
¥²¡¼¥à¤ÎÆÀÅÀÄɲ峡¼¥É¤È¤·¤Æ¡¢²¼µ¤Î¥³¡¼¥É¤ò½ñ¤¤Þ¤¹¡£
game.score += 10;
ɽ¼¨¤¹¤ë¥é¥Ù¥ë¤òÊѹ¹¤¹¤ë¤Ë¤Ï
scoreLabel.label = "APPLE:";
**Íð¿ô¤òºî¤ë(¥é¥ó¥À¥àɽ¼¨) [#f8deb4c9]
Ũ¥¥ã¥é¤ä¾ã³²Êª¤Ê¤É¤ò¥Ð¥é¥Ð¥é¤Ëɽ¼¨¤¹¤ë¤³¤È¤ò¥é¥ó¥À¥àɽ...
A = rand(10); //
**¥¿¥Ã¥Á¥Ñ¥Ã¥ÉÂбþ [#y718b9d7]
¥¹¥Þ¡¼¥È¥Õ¥©¥ó¤Ê¤É¤Î¥¿¥Ã¥Á¥Ñ¥Ã¥ÉÂбþ¤Ë¤¹¤ë¤Ë¤Ï¡¢²¼µ¤Î¥³...
var pad = new Pad();
pad.x = 0;
pad.y = 220;
game.rootScene.addChild(pad);
pad.x¤Èpad.y¤Ç¡¢ÁàºîÍѥѥåɤÎɽ¼¨°ÌÃÖ¤ò»ØÄê¡£
**¥µ¥ó¥×¥ë [#t3df58f2]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-30Éô֤ǡ¢¤Ç¤¤ë¤À¤±¤¿¤¯¤µ¤ó¥ê¥ó¥´¤ò½¸¤á¤Æ¤¯¤À¤µ¤¤¡£
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-º¸²¼¤Î½½»ú¥¨¥ê¥¢¤ò»È¤¦¤È¡¢¥Þ¥¦¥¹¥¯¥ê¥Ã¥¯(¥Ñ¥½¥³¥ó)¡¢¥¿¥Ã...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson8.lzh)
*¥²¡¼¥à²èÌ̤ò½Å¤Í¹ç¤ï¤»¤ë [#hfa3967f]
Ê£»¨¤Ê¥²¡¼¥à²èÌ̤òɽ¼¨¤µ¤»¤ë¤È¤¤Ï¡¢½Å¤Í¹ç¤ï¤»¤ë¤è¤¦¤Ëºî...
enchant.js¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ë½Å¤Í¤ë²èÌ̤ò¥·¡¼¥ó(Scene)¤È¸Æ¤Ó...
-[[enchant.js¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤ò²òÆÉ¤¹¤ë¡ÊRPGÊÔ¤½¤Î1¡Ë | I...
-[[¡Úenchant.js¡Û ¡ÖºÇ®¤Ç¥¯¥ë¥Þ¤ò¾è¤ê¤³¤Ê¤¹¥²¡¼¥à¡×¤Îµ»...
*¥²¡¼¥à¤ò9leap¤Ç¸ø³«¤¹¤ë [#q01863b9]
9leap¤Ï¡¢enchant.js¤ò»È¤Ã¤¿¥²¡¼¥à¤ÎÅê¹Æ¥µ¥¤¥È¡£Åê¹Æ¤µ¤ì¤¿...
-[[9leap : ¥È¥Ã¥×¥Ú¡¼¥¸ - ¤É¤³¤Ç¤âÍ·¤Ù¤ë¡¢Åê¹Æ·¿¥²¡¼¥à¥µ...
¥í¥°¥¤¥ó¤¹¤ë¤È¥²¡¼¥à¤ÎÅê¹Æ¡¦¥³¥á¥ó¥È¤ÎÅê¹Æ¤¬²Äǽ¤Ë¤Ê¤ë¤Û...
Ʊ¤¸¥²¡¼¥à¤Ç¥×¥ì¥¤¤·¤¿Twitter¤Ç¥Õ¥©¥í¡¼¤·¤Æ¤¤¤ë¿Í¤Î¾ðÊó...
¥²¡¼¥à¤ò¤ªµ¤¤ËÆþ¤ê¤ËÄɲ䷤ơ¢¸å¤«¤éÍ·¤Ö¤³¤È¤â¤Ç¤¤Þ¤¹¡£
9leap¤Ë¥í¥°¥¤¥ó¤¹¤ë¤Ë¤Ï¡¢Twitter¥¢¥«¥¦¥ó¥È¤¬É¬ÍפǤ¹¡£
**Åê¹ÆÊýË¡ [#r7d51209]
¤ä¤êÊý¤Ï¡¢¤³¤Á¤é¤¬»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
-[[iPad 2¤¬Åö¤¿¤ë¥×¥í¥°¥é¥ß¥ó¥°¥³¥ó¥Æ¥¹¥È¥µ¥¤¥È¡Ø9leap¡Ù...
**9leap¤ËÅê¹Æ¤·¤Æ¤ß¤¿ [#c4044f76]
-[[9leap : 30Éᢥê¥ó¥´½¸¤á¥²¡¼¥à by y_catch - ¤É¤³¤Ç¤âÍ·...
*ÇØ·Ê¡¿¥Þ¥Ã¥×¤Îɽ¼¨ [#m1aa7ffd]
¥²¡¼¥à¤òºî¤ë¤È¤¡¢¥¥ã¥é¥¯¥¿¡¼¤À¤±¤Ç¤Ï¤µ¤Ó¤·¤¤¤Î¤Ç¡¢ÇØ·Ê...
ÇØ·Ê¤Ë¤Ï¡¢ÇØ·Ê¿§¤ò»ØÄꤹ¤ëÊýË¡¤È²èÁü¤ò»ØÄꤹ¤ëÊýË¡¤¬¤¢¤ê...
**ÇØ·Ê¿§¤Î»ØÄê [#g6911641]
ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¥·¡¼¥ó(game.rootScene)¤Î...
game.rootScene.backgroundColor = 'rgb(182, 255, 255)';
**ÇØ·Ê²èÁü¤Îɽ¼¨ [#n13e96b1]
ÇØ·Ê²èÁü¤Îɽ¼¨¤¹¤ë¤Ë¤Ï¡¢¤Þ¤ºÇطʤθµ¤Ë¤Ê¤ëÁǺà²èÁü¤òÍѰÕ...
#ref(map2.gif)
¤³¤Î9¡ß3¥Þ¥¹¤Î²èÁü¤Ï¡¢¼¡¤Î¤è¤¦¤ËÈÖ¹æ¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
0, 1, 2, 3, 4, 5, 6, 7, 8
9,10,11,12,13,14,15,16,17
18,19,20,21,22,23,24,25,26
¼¡¤Ë¡¢¤³¤Î²èÁü¤ò¤É¤Î¤è¤¦¤Ë¤Ê¤é¤Ù¤ë¤«¡¢¿ôÃͤǻØÄꤷ¤Þ¤¹¡£
ÁǺà²èÁü¤òÇÛÃÖ¤·¤¿¤¤¤È¤³¤í¤Ë¤Ï¡¢¤½¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£
¤Ê¤Ë¤â¤Ê¤¤¤È¤³¤í¤Ï¡Ö-1¡×¤ò»ØÄꤷ¤Þ¤¹¡£
º£²ó¤Ï¡¢²£20¥Þ¥¹¡¢½Ä10¥Þ¥¹¤Î²èÁü¤òÇØ·Ê¤È¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£
var blocks = [
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4],
[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],
];¡¡
¤³¤ì¤ò¼ÂºÝ¤ËÇÛÃÖ¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
-game.preload('bear.gif', 'map2.gif'); ¤ÇÁǺà²èÁü¤òÆÉ¤ß¹þ¤à
-¼¡¤Î¥³¡¼¥É¤ÇÇØ·Ê¤ò»ØÄê
var map = new Map(16, 16);
map.image = game.assets['map2.gif'];
map.loadData(blocks);
-game.rootScene.addChild(map); ¤Ç¡¢ºÇ¸å¤ËÅÐÏ¿
**¥µ¥ó¥×¥ë [#b332014e]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-ÇØ·Ê¤¬É½¼¨¤µ¤ì¡¢º¸±¦¤ÎÌð°õ¥¡¼¤Ç¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson3.lzh)
*nakamura001 ¥µ¥ó¥×¥ë½¸ [#z2822510]
¤³¤³¤Þ¤Ç¡¢¥·¥³¥·¥³¤Èenchant.js¤Î¥µ¥ó¥×¥ë¤òºî¤Ã¤Æ¤¤¿¤é¡¢...
-[[nakamura001 @ ¥¦¥£¥ - ¥È¥Ã¥×¥Ú¡¼¥¸/JavaScript¥²¡¼¥à/...
-¥¥ã¥é¥¯¥¿¡¼¤ò±¦¤Ë°Üư [[¥½¡¼¥¹:http://tsuyobi.heteml.jp...
-¥¥ã¥é¥¯¥¿¡¼¤òÊý¸þ¥¡¼¤Ç°Üư [[¥½¡¼¥¹:http://tsuyobi.het...
-±ýÉü°Üư½èÍý(¥¥ã¥é¥¯¥¿¡¼¤Î²èÁüȿž) [[²òÀâ:http://d.hat...
-¥¿¥Ã¥×¤·¤¿°ÌÃ֤˥¥ã¥é¥¯¥¿¡¼¤ò°Üư [[¥½¡¼¥¹:http://tsuyo...
-¥é¥Ù¥ë¤Îɽ¼¨ [[¥½¡¼¥¹:http://tsuyobi.heteml.jp/html/java...
-Åö¤¿¤êȽÄê(¥é¥¤¥Ö¥é¥ê¤Î¥á¥½¥Ã¥É¤ò»È¤ï¤º¤Ë¼«Á°¤ÇȽÄê) [[...
-Åö¤¿¤êȽÄê(¥é¥¤¥Ö¥é¥ê¤Î¥á¥½¥Ã¥É¤ÇȽÄê) [[¥½¡¼¥¹:http://t...
-¥¥ã¥é¥¯¥¿¡¼¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÊýË¡ [[²òÀâ:http://d.hatena....
-¥¥ã¥é¥¯¥¿¡¼¤ÎÄɲÃÊýË¡ [[²òÀâ:http://d.hatena.ne.jp/naka...
-¼Ö¤Î°Üư½èÍý [[²òÀâ:http://d.hatena.ne.jp/nakamura001/20...
-¥ì¥¤¥ä¡¼¤ÎÁ°¸å´Ø·¸¤ò¹Íθ¤·¤¿¥¥ã¥é¥¯¥¿¡¼ÄɲÃÊýË¡ [[²òÀâ:...
-ÊüʪÀþ¾õ¤Ëʪ¤òÅꤲ¤ëÊýË¡ [[²òÀâ:http://d.hatena.ne.jp/na...
*git [#ecca0cf8]
-[[ycatch/test_enchant.js - GitHub:https://github.com/yca...
½ªÎ»¹Ô:
[[Programing]]
¤³¤³¤Ï¡¢enchant.js¤ò¤Ï¤¸¤á¤ë¤È¤¤ËɬÍפʡ¢¤´¤¯¤´¤¯´ðËÜŪ...
enchant.js¤ËÉÕ°¤Î¥µ¥ó¥×¥ë¤Î¥¢¥¯¥·¥ç¥ó¥²¡¼¥à(\examples\ac...
enchant.js¤Ï¡¢¥²¡¼¥à¥×¥í¥°¥é¥à¤òºî¤ë¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¥×¥í...
HTML5¤ÈJavascript¤È¤¤¤¦µ»½Ñ¤Çºî¤é¤ì¤Æ¤¤¤Æ¡¢¥Ñ¥½¥³¥ó¤À¤±¤¸...
¤³¤³¤Ç¤Ï¡¢¾¯¤·¤º¤Ä¥³¡¼¥É¤òÊ£»¨¤Ë¤·¤Æ¤¤¤Ã¤Æ¡¢¥¯¥Þ¤¬Áö¤ê²ó...
-[[9leap : 30Éᢥê¥ó¥´½¸¤á¥²¡¼¥à by y_catch - ¤É¤³¤Ç¤âÍ·...
-30Éô֤ǡ¢¤Ç¤¤ë¤À¤±¤¿¤¯¤µ¤ó¥ê¥ó¥´¤ò½¸¤á¤Æ¤¯¤À¤µ¤¤¡£
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-º¸²¼¤Î½½»ú¥¨¥ê¥¢¤ò»È¤¦¤È¡¢¥Þ¥¦¥¹¥¯¥ê¥Ã¥¯(¥Ñ¥½¥³¥ó)¡¢¥¿¥Ã...
¤â¤¦¾¯¤·¥²¡¼¥à¤é¤·¤¯¤·¤¿¡£
-[[9leap : 30Éᢥê¥ó¥´½¸¤á¥²¡¼¥àPart2:http://9leap.net/g...
#ref(1176_140.gif)
#contents
*¥À¥¦¥ó¥í¡¼¥É [#yc6b9b9f]
-[[enchant.js - HTML5 + JavaScript Game Engine:http://enc...
*ɬÍפʥե¡¥¤¥ë [#b8f4e08f]
enchant.js¤«¤é¡¢¼¡¤Î¥Õ¥¡¥¤¥ë¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
¥¯¥Þ²èÁü(bear.gif)¤Ï¡¢²þÎɤ·¤Æ¤¤¤Þ¤¹¡£
- enchant.js¡§enchant.jsËÜÂÎ
- game.js¡§¥²¡¼¥à¤Î¥á¥¤¥ó¥×¥í¥°¥é¥à
- index.html¡§¥á¥¤¥ó¥×¥í¥°¥é¥à¤ò¸Æ¤Ó½Ð¤¹HTML¥Õ¥¡¥¤¥ë¡£¤³...
- bear.gif:²èÁü¥Õ¥¡¥¤¥ë
#ref(bear.gif)
* index.html [#nde0ff97]
¥²¡¼¥à¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ index.html¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¡£¤³¤³¤«...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-widt...
<meta name="apple-mobile-web-app-capable" conten...
<meta name="apple-mobile-web-app-status-bar-styl...
<title>Sample Game</title>
<script type="text/javascript" src="enchant.js">...
<script type="text/javascript" src="game.js"></s...
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
</body>
</html>
* game.js¤Î´ðËÜ¥³¡¼¥É [#b1f8a8b5]
¥²¡¼¥à¤Î¥á¥¤¥ó¥×¥í¥°¥é¥à¤Ç¤¢¤ëgame.js¤Î´ðËÜŪ¤Ê¹½À®¤ò½çÈÖ...
**²¿¤â¤·¤Ê¤¤¥³¡¼¥É [#z5168b76]
¤³¤ì¤¬¡¢´ðËÜ·Á¡£¤¤¤Á¤ª¤¦¡¢²èÁü¥Õ¥¡¥¤¥ë(bear.gif)¤òÆÉ¤ß¹þ...
²¼µ¤Î¥Æ¥¥¹¥È¤ògame.js¤È¤¤¤¦¥Æ¥¥¹¥È¥Õ¥¡¥¤¥ë¤È¤·¤ÆÊݸ¤¹...
enchant();
window.onload = function() {
var game = new Game(320, 320); //¥²¡¼¥à²èÌ̤òÀßÄê
game.preload('bear.gif'); //²èÁü¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ß
game.onload = function() {
//¡Ö{¡×¤È¡Ö}¡×¤Î´Ö¤Ë¡¢¥²¡¼¥à¤Îưºî¤òµ½Ò¤¹¤ë
}
game.start();
}
**²èÁü¤ò¤¿¤Àɽ¼¨¤¹¤ë [#qb76c8e5]
Á°½Ò¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤´¹¤¨¤Æ¡¢¥¹¥×¥é¥¤¥Èµ¡Ç½(Sprite)¤Ç²èÁü...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
game.rootScene.addChild(bear);
}
game.start();
}
**ɽ¼¨¤¹¤ë²èÁü¤òÊѤ¨¤ë [#p7e99849]
Ê£¿ô¤Î¥¤¥á¡¼¥¸¤ò»ý¤Ã¤Æ¤¤¤ë²èÁü¤Î¾ì¹ç¡¢¥¹¥×¥é¥¤¥È¤ÇÊ̤Υ¤...
¥¯¥Þ¤¬Ê⤤¤Æ¤¤¤ë¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Ê¤É¤Ë»È¤¨¤Þ¤¹(¤Þ¤ÀÊ⤤ޤ»...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
bear.frame = 1;
game.rootScene.addChild(bear);
}
game.start();
}
**ɽ¼¨°ÌÃÖ¤ò»ØÄê [#mb934d47]
¥¹¥×¥é¥¤¥È¤Î°ÌÃÖ¤ò»ØÄê
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
bear.x = 150;
bear.y = 150;
bear.frame = 1;
game.rootScene.addChild(bear);
}
game.start();
}
**¥¡¼ÆþÎϤDzèÁü¤òÀÚ¤êÂØ¤¨ [#s89a6625]
º¸±¦¤ÎÌð°õ¥¡¼¤ò²¡¤·¤Æ¡¢²èÁü¤òÀÚ¤êÂØ¤¨
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.x = 150;
bear.y = 150;
if(game.input.left) bear.frame = 1;
if(game.input.right) bear.frame = 2;
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó£± [#f6c15a11]
º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¤½¤Î¾ì¤ÇÁö¤ë
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.x = 150;
bear.y = 150;
if(game.input.right) {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
}
if(game.input.left) {
if(bear.frame == 4) {
bear.frame = 5;
} else {
bear.frame = 4;
}
}
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó£² [#v06aaf4f]
º¸±¦¤ÎÌð°õ¥¡¼¤ÇÁö¤ë¡£ÊɤÏ̵»ë¡£
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.y = 150;
if(game.input.right) {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
bear.x += 5;
}
if(game.input.left) {
if(bear.frame == 4) {
bear.frame = 5;
} else {
bear.frame = 4;
}
bear.x -= 5;
}
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó£³ [#r9bd2f81]
º¸±¦¤ÎÌð°õ¥¡¼¤ÇÁö¤ë¡£Êɤǻߤޤ롣
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
bear.y = 150;
if(game.input.right) {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
if (bear.x < 300) {
bear.x += 5;
} else {
bear.x = 300;
}
}
if(game.input.left) {
if(bear.frame == 4) {
bear.frame = 5;
} else {
bear.frame = 4;
}
if (bear.x > 0) {
bear.x -= 5;
} else {
bear.x = 0;
}
}
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥µ¥ó¥×¥ë [#t3df58f2]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson1.lzh)
*ʸ»ú¤òɽ¼¨¤¹¤ë [#rff46cbc]
²èÌ̾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë¤Ë¤Ï¡¢¥é¥Ù¥ëµ¡Ç½(Label)¤ò»È¤¤¤Þ¤¹¡£
**²èÌ̾åÉô¤Ë¸ÇÄê¤Çʸ»ú¤òɽ¼¨¤¹¤ë [#u7bfd3f6]
¡ÖRunning Bear:¡×¤È¤¤¤¦Ê¸»ú¤òɽ¼¨¤¹¤ë
enchant();
window.onload = function() {
var game = new Game(320, 320);
var label = new Label("Running Bear:");
label.x = 0;
label.y = 0;
game.rootScene.addChild(label);
game.start();
}
**ʸ»ú¤ò½ñ¤´¹¤¨¤ë [#l4d79b5d]
¸ÇÄê¤Ç¤Ï¤Ê¤¯¡¢É½¼¨¤·¤Æ¤¤¤ëʸ»ú¤òÊѲ½¤µ¤»¤ë
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload("bear.gif");
var label = new Label("Running Bear:");
label.x = 0;
label.y = 0;
game.rootScene.addChild(label);
game.onload = function() {
var label_time = new Label();
label_time.x = 0;
label_time.y = 14;
label_time.addEventListener('enterframe', functi...
label_time.text = game.frame;
});
game.rootScene.addChild(label_time);
}
game.start();
}
**¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Èʸ»úɽ¼¨ [#x93a3f15]
¥¯¥Þ¤¬Áö¤ê¡¢·Ð²á»þ´Ö¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Î¥¹¥Ô¡¼¥É¤ò¡Ögame.fps = 15;¡×¤ÇÄ´À°¤·¤Æ¤¤...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload("bear.gif");
game.fps = 15;
var label = new Label("Running Bear:");
label.x = 0;
label.y = 0;
game.rootScene.addChild(label);
game.onload = function() {
//¥é¥Ù¥ë¤Çʸ»úɽ¼¨
var label_time = new Label();
label_time.x = 0;
label_time.y = 14;
¡¡¡¡¡¡¡¡label_time.addEventListener('enterframe',...
label_time.text = game.frame;
});
game.rootScene.addChild(label_time);
//¥¹¥×¥é¥¤¥È¤Ç¥¯¥Þɽ¼¨
var bear = new Sprite(20, 30);
¡¡¡¡¡¡¡¡bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
if(bear.frame == 1) {
bear.frame = 2;
} else {
bear.frame = 1;
}
bear.x += 5
if (bear.x > 300) {
bear.x = 0;
}
bear.y = 50;
});
game.rootScene.addChild(bear);
}
game.start();
}
**¥µ¥ó¥×¥ë [#dcb86424]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-¥¯¥Þ¤¬Áö¤ê¡¢·Ð²á»þ´Ö¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson2.lzh)
*¸ú²Ì²»¤ò½Ð¤¹ [#o4cfc1f5]
¥²¡¼¥à¤Ë¸ú²Ì²»¤¬¤Ä¤¯¤È¡¢³Ú¤·¤µÇÜÁý¤Ç¤¹¡£
**¤È¤Ë¤«¤¯²»¤ò½Ð¤¹ [#hab3d314]
¥µ¥¦¥ó¥É¥Õ¥¡¥¤¥ë()¤òÆÉ¤ß¹þ¤ó¤Ç¡¢¤½¤ì¤ò¡Ö.play¡×¤ÇºÆÀ¸¤·¤Þ...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('jump.wav');
game.onload = function() {
var sound = game.assets['jump.wav'].play();
sound.play();
};
game.start();
};
**Áàºî¤Ë¤¢¤ï¤»¤Æ²»¤ò½Ð¤¹¡£ [#se2442cc]
²èÁüɽ¼¨¤Î¤È¤³¤í¤Ë¡¢ºÆÀ¸¤òÁȤ߹þ¤ß¤Þ¤¹¡£
¢¨¸ú²Ì²»¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤á¤Ê¤¯¤Æ¡¢²¿ÅÙ¤«¶ìÏ«¤·¤Þ¤·¤¿¡£ench...
enchant();
window.onload = function() {
var game = new Game(320, 320);
game.preload('jump.wav', 'bear.gif');
game.onload = function() {
game.assets['jump.wav'].play();
var bear = new Sprite(20, 30);
bear.image = game.assets['bear.gif'];
bear.addEventListener('enterframe', function() {
if(game.input.right) {
var sound = game.assets['jump.wav'].clone();
sound.play();
}
});
game.rootScene.addChild(bear);
};
game.start();
};
**¥µ¥ó¥×¥ë [#m807a206]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-±¦Ìð°õ¥¡¼¤Ç²»¤¬½Ð¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson4.lzh)
*²èÁü¤òÉôÉʲ½¤¹¤ë [#h52552ae]
¥×¥í¥°¥é¥à¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÉôÉʤÎÁȤ߹ç¤ï¤»¤È¤·¤Æºî¤ë¤È¡¢ºî...
**¥¥ã¥é²èÁü¤òÉôÉʲ½ [#n27ba729]
Kuma¤È¤¤¤¦ÉôÉÊ(¥ª¥Ö¥¸¥§¥¯¥È)¤òÄêµÁ¡£¤½¤ì¤òplayer1¤Èplayer...
¤Ò¤È¤Ä¤ÎÀ߷׿Þ(Kuma)¤«¤é¡¢Ê£¿ô¤ÎÉôÉʤòºî¤ê½Ð¤·¤Æ¤¤¤Þ¤¹¡£...
enchant();
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
enchant.Sprite.call(this, 20, 30);
this.image = game.assets['bear.gif'];
this.x = x; this.y = y; this.frame = 0;
game.rootScene.addChild(this);
}
});
window.onload = function() {
game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
player1 = new Kuma(0, 0);
player1.frame = 1;
player2 = new Kuma(30, 0);
player2.frame = 2;
}
game.start();
}
**ÉôÉʲ½¤·¤¿²èÁü¤ò°Üư [#ia4fd2e6]
ÉôÉʤǤϡ¢ÉôÉʤÎÀ߷׿Þ¦¤Çưºî¤òÄêµÁ¤Ç¤¤Þ¤¹¡£¤³¤³¤Ç¤Ï¡¢K...
enchant();
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
enchant.Sprite.call(this, 20, 30);
this.image = game.assets['bear.gif'];
this.x = x; this.y = y; this.frame = 0;
game.rootScene.addChild(this);
},
move_right: function() {
this.x += 5;
},
move_left: function() {
this.x -= 5;
}
});
window.onload = function() {
game = new Game(320, 320);
game.preload('bear.gif');
game.onload = function() {
player = new Kuma(0, 0);
game.addEventListener('enterframe', function() {
if(game.input.right) {
player.move_right();
}
if(game.input.left) {
player.move_left();
}
});
}
game.start();
}
**ÉôÉʲ½¤·¤¿¥¥ã¥é¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó [#q6b81d2f]
¤¯¤Ã¤Ä¤±¤Æ¤ß¤¿¡£¥¡¼ÆþÎϤθ¡½Ð¤Ï¡¢ÉôÉʦ¤Ë°Üư¤·¤¿¡£¤³¤ì...
¥¥ã¥é¤Ïº¸±¦¥¡¼¤ÇÁà½Ä¤Ç¤¤ë¡£
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.KUMA_WIDTH = 20;
this.KUMA_HEIGHT = 30;
this.KUMA_Y = 50;
this.dir = 0; //¿Ê¹ÔÊý¸þ 0:±¦(right)¡¢1:º¸(left)
this.walk = 0; //Êâ¹Ô¥Ý¡¼¥º 0:Ää»ß 1:±¦Â 2:º¸Â
this.step = 5;
enchant.Sprite.call(this, this.KUMA_WIDTH, this.KUMA_H...
this.image = game.assets['bear.gif'];
this.x = x;
this.y = this.KUMA_Y;
this.frame = 0;
this.addEventListener('enterframe', function() {
if(game.input.right) {
this.move_right();
} else if(game.input.left) {
this.move_left();
} else {
this.move_stop();
}
this.change_frame();
});
game.rootScene.addChild(this);
},
move_right: function() {
this.dir = 0;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x < (SCREEN_WIDTH - this.KUMA_WIDTH)) {
this.x += this.step;
} else {
this.x = SCREEN_WIDTH - this.KUMA_WIDTH;
}
},
move_left: function() {
this.dir = 1;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x > 0) {
this.x -= this.step;
} else {
this.x = 0;
}
},
move_stop: function(){
if(this.walk !== 0) {
game.assets['jump.wav'].play();
}
this.walk = 0;
},
change_frame: function() {
this.frame = this.dir * 3 + this.walk;
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.preload('jump.wav', 'bear.gif');
game.onload = function() {
player = new Kuma(0, 0);
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson5.lzh)
*Ê£¿ô¤Î¥Ñ¡¼¥Ä¤òư¤«¤¹ [#f49c9150]
¥¢¥¯¥·¥ç¥ó¥²¡¼¥à¤Ç¤Ï¡¢Ê£¿ô¤ÎŨµ¡¤ä¥¿¡¼¥²¥Ã¥È¤¬Åо줷¤Þ¤¹...
**Ê£¿ô¤Î²èÁü¤òɽ¼¨¤¹¤ë [#he4e0e00]
¤Þ¤ºÊ£¿ô¤Î²èÁü¤òɽ¼¨¤¹¤ëÁ°¤Ë¡¢²èÁü¤ò¤Ò¤È¤Ä¤À¤±ÉôÉʲ½¤·¤Æ...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('icon0.gif');
game.onload = function() {
target = new Apple(100, 0);
}
game.start();
}
**Ê£¿ô¤Î²èÁü¤òư¤«¤¹ [#oda390f1]
¤³¤ì¤ò²þ¤¤·¤ÆÊ£¿ô¥¥ã¥é¤òư¤«¤»¤ë¤è¤¦¤Ë¤¹¤ë¤È¡¢¤³¤¦¤Ê¤ê...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('icon0.gif');
game.onload = function() {
targets = [];
game.rootScene.addEventListener('enterframe', function...
if((game.frame % 10) == 0){
var x = Math.floor(Math.random() * 300);
targets[game.frame] = new Apple(x, 0);
}
});
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson6-2.lzh)
¤³¤ì¤Ë¡¢Ì£Êý¥¥ã¥é¤òÉÕ¤±²Ã¤¨¤ë¤È¡¢¤½¤ì¤é¤·¤¯¤Ê¤Ã¤Æ¤¤Þ¤¹...
**¼«¥¥ã¥é(Áà½Ä¤Ç¤¤ë)¤ÈŨ¥¥ã¥é¤òƱ»þ¤Ëɽ¼¨¤¹¤ë [#v823b7...
º¸±¦¥¡¼¤ÇÁà½Ä¤Ç¤¤ë¼«¥¥ã¥é¤È¡¢Å¨¥¥ã¥é¤òƱ»þ¤Ëɽ¼¨¤¹¤ë...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
//Áà½Ä¤Ç¤¤ë¼«¥¥ã¥é
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.KUMA_WIDTH = 20;
this.KUMA_HEIGHT = 30;
this.KUMA_Y = 200;
this.dir = 0; //¿Ê¹ÔÊý¸þ 0:±¦(right)¡¢1:º¸(left)
this.walk = 0; //Êâ¹Ô¥Ý¡¼¥º 0:Ää»ß 1:±¦Â 2:º¸Â
this.step = 5;
enchant.Sprite.call(this, this.KUMA_WIDTH, this.KUMA_H...
this.image = game.assets['bear.gif'];
this.x = x;
this.y = this.KUMA_Y;
this.frame = 0;
this.addEventListener('enterframe', function() {
if(game.input.right) {
this.move_right();
} else if(game.input.left) {
this.move_left();
} else {
this.move_stop();
}
this.change_frame();
});
game.rootScene.addChild(this);
},
move_right: function() {
this.dir = 0;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x < (SCREEN_WIDTH - this.KUMA_WIDTH)) {
this.x += this.step;
} else {
this.x = SCREEN_WIDTH - this.KUMA_WIDTH;
}
},
move_left: function() {
this.dir = 1;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x > 0) {
this.x -= this.step;
} else {
this.x = 0;
}
},
move_stop: function(){
if(this.walk !== 0) {
game.assets['jump.wav'].play();
}
this.walk = 0;
},
change_frame: function() {
this.frame = this.dir * 3 + this.walk;
}
});
//Ê£¿ôɽ¼¨¤µ¤ì¤ëÁê¼ê¥¥ã¥é
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('bear.gif', 'icon0.gif', 'jump.wav');
game.onload = function() {
player = new Kuma(0, 0);
targets = [];
game.rootScene.addEventListener('enterframe', function...
if((game.frame % 10) == 0){
var x = Math.floor(Math.random() * 300);
targets[game.frame] = new Apple(x, 0);
}
});
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson6-3.lzh)
¤³¤ì¤ËÅö¤¿¤êȽÄê¤òÉÕ¤±²Ã¤¨¤ë¤È¡¢¥²¡¼¥à¤Ã¤Ý¤¯¤Ê¤ê¤Þ¤¹¤Í¡£
**Åö¤êȽÄê [#vf730204]
¼«¥¥ã¥é¤ÈÁê¼ê¥¥ã¥é¤¬ÀÜ¿¨¤·¤¿¤«¤É¤¦¤«¡¢Åö¤êȽÄê¤ò¹Ô¤¤¤Þ...
enchant();
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 320;
score = 0;
//Áà½Ä¤Ç¤¤ë¼«¥¥ã¥é
var Kuma = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.KUMA_WIDTH = 20;
this.KUMA_HEIGHT = 30;
this.KUMA_Y = 200;
this.dir = 0; //¿Ê¹ÔÊý¸þ 0:±¦(right)¡¢1:º¸(left)
this.walk = 0; //Êâ¹Ô¥Ý¡¼¥º 0:Ää»ß 1:±¦Â 2:º¸Â
this.step = 5;
enchant.Sprite.call(this, this.KUMA_WIDTH, this.KUMA_H...
this.image = game.assets['bear.gif'];
this.x = x;
this.y = this.KUMA_Y;
this.frame = 0;
this.addEventListener('enterframe', function() {
if(game.input.right) {
this.move_right();
} else if(game.input.left) {
this.move_left();
} else {
this.move_stop();
}
this.change_frame();
});
game.rootScene.addChild(this);
},
move_right: function() {
this.dir = 0;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x < (SCREEN_WIDTH - this.KUMA_WIDTH)) {
this.x += this.step;
} else {
this.x = SCREEN_WIDTH - this.KUMA_WIDTH;
}
},
move_left: function() {
this.dir = 1;
if((this.walk == 0) || (this.walk == 2)){
this.walk = 1;
} else if(this.walk == 1) {
this.walk = 2;
}
if (this.x > 0) {
this.x -= this.step;
} else {
this.x = 0;
}
},
move_stop: function(){
this.walk = 0;
},
change_frame: function() {
this.frame = this.dir * 3 + this.walk;
}
});
//Ê£¿ôɽ¼¨¤µ¤ì¤ëÁê¼ê¥¥ã¥é
var Apple = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y){
this.WIDTH = 16;
this.HEIGHT = 16;
this.STEP = 5;
enchant.Sprite.call(this, this.WIDTH, this.HEIGHT);
this.image = game.assets['icon0.gif'];
this.x = x;
this.y = y;
this.frame = 15;
this.addEventListener('enterframe', function(){
this.move_step();
});
game.rootScene.addChild(this);
},
move_step: function() {
this.y += this.STEP;
//Åö¤êȽÄê
if(this.intersect(player)){
this.remove();
game.assets['jump.wav'].play();
}
//²¼Ã¼¤ËÅþã
if (this.y >= (SCREEN_HEIGHT - this.HEIGHT)) {
this.remove();
}
},
remove: function(){
game.rootScene.removeChild(this);
}
});
window.onload = function() {
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
game.fps = 15;
game.preload('bear.gif', 'icon0.gif', 'jump.wav');
game.onload = function() {
player = new Kuma(0, 0);
targets = [];
game.rootScene.addEventListener('enterframe', function...
if((game.frame % 10) == 0){
var x = Math.floor(Math.random() * 300);
targets[game.frame] = new Apple(x, 0);
}
});
}
game.start();
}
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson7.lzh)
*¥²¡¼¥àºîÀ®¤ËÊØÍø¤Ê¥×¥é¥°¥¤¥ó [#o7f33f99]
enchant.js¤Ï¡¢¥×¥é¥°¥¤¥ó(plugin)¤Çµ¡Ç½¤ò³ÈÄ¥¤Ç¤¤Þ¤¹¡£
¥²¡¼¥à¤òºî¤ë¤È¤¤â¡¢¥×¥é¥°¥¤¥ó¤ò³èÍѤ¹¤ë¤Èºî¶È¸úΨ¤¬¾å¤¬...
-[[plugin¡¿enchant.js - HTML5 + JavaScript Game Engine:ht...
²¼µ¤â»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
-[[enchant.js¤Çº£¤Þ¤Çºî¤Ã¤¿¥²¡¼¥à¤ò¡Ø9leap¡Ù»ÅÍͤˤ¹¤ëÊý...
**¥×¥é¥°¥¤¥ó¤Î»È¤¤Êý [#x47ae7cf]
¥×¥é¥°¥¤¥ó¤Ï¡¢enchant.js¤ÈƱ¤¸¥Õ¥©¥ë¥À¤«¡¢¤½¤Îľ²¼¤Îplugi...
enchant.js¤ò²òÅष¤¿¾ì¹ç¤Ï¡¢¸å¼Ô¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¤½¤ì¤«¤é¡¢¥×¥é¥°¥¤¥ó¤¬É¬ÍפȤ¹¤ë²èÁü¤òƱ¤¸¥Õ¥©¥ë¥À¤ËÍѰÕ...
-nineleap.enchant.js¤Î¾ì¹ç
--start.png
--end.png
--font.png
-ui.enchant.js¤Î¾ì¹ç
--apad.png
--pad.png
¤¢¤È¤Ï¡¢index.html¤Ë¥×¥é¥°¥¤¥ó¥Õ¥¡¥¤¥ë¤Îµ½Ò¤òÄɲä·¤Þ¤¹¡£
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-widt...
<meta name="apple-mobile-web-app-capable" conten...
<meta name="apple-mobile-web-app-status-bar-styl...
<title>enchant</title>
<script type="text/javascript" src="enchant.js">...
<script type="text/javascript" src="plugins/nine...
<script type="text/javascript" src="plugins/util...
<script type="text/javascript" src="plugins/ui.e...
<script type="text/javascript" src="game.js"></s...
<style type="text/css">
body {margin: 0;}
</style>
</head>
<body>
</body>
</html>
¾åµ¤Ç¤Ï¡¢10-11¹ÔÌܤÇplugins¥Õ¥©¥ë¥À¤Ë¤¢¤ë¥×¥é¥°¥¤¥ó¥Õ¥¡...
**¥¹¥¿¡¼¥È²èÌÌ [#g122127c]
nineleap.enchant.js¤òÆÉ¤ß¹þ¤à¤È¡¢¥²¡¼¥à¥¹¥¿¡¼¥È»þ¤Ë¼«Æ°Åª...
**½ªÎ»²èÌÌ [#h45a6768]
nineleap.enchant.js¤òÆÉ¤ß¹þ¤ß¡¢¥²¡¼¥à½ªÎ»¤¹¤Ù¤¤È¤³¤í¤Ë²¼...
game.end(game.score, "game end");
game.score¤Ï¡¢ÆÀÅÀ¤ò³ÊǼ¤·¤¿ÊÑ¿ô¡£
**¥¿¥¤¥àɽ¼¨ [#df53f786]
¥×¥í¥°¥é¥àËÜÂÎ(game.onload = function()¤Î¤È¤³¤í)¤Ë¡¢²¼µ...
timeLabel = new TimeLabel(8, 8);
game.rootScene.addChild(timeLabel);
²¼µ¤Î¤è¤¦¤Ë½ñ¤¯¤È¥«¥¦¥ó¥È¥À¥¦¥ó¡£
timeLabel = new TimeLabel(8, 8, "countdown");
timeLabel.time = 30;
game.rootScene.addChild(timeLabel);
ɽ¼¨¤¹¤ë¥é¥Ù¥ë¤òÊѹ¹¤¹¤ë¤Ë¤Ï
timeLabel.label = "LIFE:";
¸½ºß¤Î·Ð²á»þ´Ö¤ò¼è¤ê½Ð¤¹¤Ë¤Ï¡¢
A = timeLabel.label;
**¥¹¥³¥¢É½¼¨ [#w26baaee]
¥×¥í¥°¥é¥àËÜÂΤνé´ü²½Éôʬ(window.onload = function() )¤Ë...
game.score = 0; //ÆÀÅÀ¤Î½é´ü²½
¥×¥í¥°¥é¥àËÜÂÎ(game.onload = function()¤Î¤È¤³¤í)¤Ë¡¢²¼µ...
scoreLabel = new ScoreLabel(40, 8);
game.rootScene.addChild(scoreLabel);
¥²¡¼¥à¤ÎÆÀÅÀÄɲ峡¼¥É¤È¤·¤Æ¡¢²¼µ¤Î¥³¡¼¥É¤ò½ñ¤¤Þ¤¹¡£
game.score += 10;
ɽ¼¨¤¹¤ë¥é¥Ù¥ë¤òÊѹ¹¤¹¤ë¤Ë¤Ï
scoreLabel.label = "APPLE:";
**Íð¿ô¤òºî¤ë(¥é¥ó¥À¥àɽ¼¨) [#f8deb4c9]
Ũ¥¥ã¥é¤ä¾ã³²Êª¤Ê¤É¤ò¥Ð¥é¥Ð¥é¤Ëɽ¼¨¤¹¤ë¤³¤È¤ò¥é¥ó¥À¥àɽ...
A = rand(10); //
**¥¿¥Ã¥Á¥Ñ¥Ã¥ÉÂбþ [#y718b9d7]
¥¹¥Þ¡¼¥È¥Õ¥©¥ó¤Ê¤É¤Î¥¿¥Ã¥Á¥Ñ¥Ã¥ÉÂбþ¤Ë¤¹¤ë¤Ë¤Ï¡¢²¼µ¤Î¥³...
var pad = new Pad();
pad.x = 0;
pad.y = 220;
game.rootScene.addChild(pad);
pad.x¤Èpad.y¤Ç¡¢ÁàºîÍѥѥåɤÎɽ¼¨°ÌÃÖ¤ò»ØÄê¡£
**¥µ¥ó¥×¥ë [#t3df58f2]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-30Éô֤ǡ¢¤Ç¤¤ë¤À¤±¤¿¤¯¤µ¤ó¥ê¥ó¥´¤ò½¸¤á¤Æ¤¯¤À¤µ¤¤¡£
-º¸±¦¤ÎÌð°õ¥¡¼¤Ç¡¢¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-º¸²¼¤Î½½»ú¥¨¥ê¥¢¤ò»È¤¦¤È¡¢¥Þ¥¦¥¹¥¯¥ê¥Ã¥¯(¥Ñ¥½¥³¥ó)¡¢¥¿¥Ã...
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson8.lzh)
*¥²¡¼¥à²èÌ̤ò½Å¤Í¹ç¤ï¤»¤ë [#hfa3967f]
Ê£»¨¤Ê¥²¡¼¥à²èÌ̤òɽ¼¨¤µ¤»¤ë¤È¤¤Ï¡¢½Å¤Í¹ç¤ï¤»¤ë¤è¤¦¤Ëºî...
enchant.js¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ë½Å¤Í¤ë²èÌ̤ò¥·¡¼¥ó(Scene)¤È¸Æ¤Ó...
-[[enchant.js¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤ò²òÆÉ¤¹¤ë¡ÊRPGÊÔ¤½¤Î1¡Ë | I...
-[[¡Úenchant.js¡Û ¡ÖºÇ®¤Ç¥¯¥ë¥Þ¤ò¾è¤ê¤³¤Ê¤¹¥²¡¼¥à¡×¤Îµ»...
*¥²¡¼¥à¤ò9leap¤Ç¸ø³«¤¹¤ë [#q01863b9]
9leap¤Ï¡¢enchant.js¤ò»È¤Ã¤¿¥²¡¼¥à¤ÎÅê¹Æ¥µ¥¤¥È¡£Åê¹Æ¤µ¤ì¤¿...
-[[9leap : ¥È¥Ã¥×¥Ú¡¼¥¸ - ¤É¤³¤Ç¤âÍ·¤Ù¤ë¡¢Åê¹Æ·¿¥²¡¼¥à¥µ...
¥í¥°¥¤¥ó¤¹¤ë¤È¥²¡¼¥à¤ÎÅê¹Æ¡¦¥³¥á¥ó¥È¤ÎÅê¹Æ¤¬²Äǽ¤Ë¤Ê¤ë¤Û...
Ʊ¤¸¥²¡¼¥à¤Ç¥×¥ì¥¤¤·¤¿Twitter¤Ç¥Õ¥©¥í¡¼¤·¤Æ¤¤¤ë¿Í¤Î¾ðÊó...
¥²¡¼¥à¤ò¤ªµ¤¤ËÆþ¤ê¤ËÄɲ䷤ơ¢¸å¤«¤éÍ·¤Ö¤³¤È¤â¤Ç¤¤Þ¤¹¡£
9leap¤Ë¥í¥°¥¤¥ó¤¹¤ë¤Ë¤Ï¡¢Twitter¥¢¥«¥¦¥ó¥È¤¬É¬ÍפǤ¹¡£
**Åê¹ÆÊýË¡ [#r7d51209]
¤ä¤êÊý¤Ï¡¢¤³¤Á¤é¤¬»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
-[[iPad 2¤¬Åö¤¿¤ë¥×¥í¥°¥é¥ß¥ó¥°¥³¥ó¥Æ¥¹¥È¥µ¥¤¥È¡Ø9leap¡Ù...
**9leap¤ËÅê¹Æ¤·¤Æ¤ß¤¿ [#c4044f76]
-[[9leap : 30Éᢥê¥ó¥´½¸¤á¥²¡¼¥à by y_catch - ¤É¤³¤Ç¤âÍ·...
*ÇØ·Ê¡¿¥Þ¥Ã¥×¤Îɽ¼¨ [#m1aa7ffd]
¥²¡¼¥à¤òºî¤ë¤È¤¡¢¥¥ã¥é¥¯¥¿¡¼¤À¤±¤Ç¤Ï¤µ¤Ó¤·¤¤¤Î¤Ç¡¢ÇØ·Ê...
ÇØ·Ê¤Ë¤Ï¡¢ÇØ·Ê¿§¤ò»ØÄꤹ¤ëÊýË¡¤È²èÁü¤ò»ØÄꤹ¤ëÊýË¡¤¬¤¢¤ê...
**ÇØ·Ê¿§¤Î»ØÄê [#g6911641]
ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¥·¡¼¥ó(game.rootScene)¤Î...
game.rootScene.backgroundColor = 'rgb(182, 255, 255)';
**ÇØ·Ê²èÁü¤Îɽ¼¨ [#n13e96b1]
ÇØ·Ê²èÁü¤Îɽ¼¨¤¹¤ë¤Ë¤Ï¡¢¤Þ¤ºÇطʤθµ¤Ë¤Ê¤ëÁǺà²èÁü¤òÍѰÕ...
#ref(map2.gif)
¤³¤Î9¡ß3¥Þ¥¹¤Î²èÁü¤Ï¡¢¼¡¤Î¤è¤¦¤ËÈÖ¹æ¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
0, 1, 2, 3, 4, 5, 6, 7, 8
9,10,11,12,13,14,15,16,17
18,19,20,21,22,23,24,25,26
¼¡¤Ë¡¢¤³¤Î²èÁü¤ò¤É¤Î¤è¤¦¤Ë¤Ê¤é¤Ù¤ë¤«¡¢¿ôÃͤǻØÄꤷ¤Þ¤¹¡£
ÁǺà²èÁü¤òÇÛÃÖ¤·¤¿¤¤¤È¤³¤í¤Ë¤Ï¡¢¤½¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£
¤Ê¤Ë¤â¤Ê¤¤¤È¤³¤í¤Ï¡Ö-1¡×¤ò»ØÄꤷ¤Þ¤¹¡£
º£²ó¤Ï¡¢²£20¥Þ¥¹¡¢½Ä10¥Þ¥¹¤Î²èÁü¤òÇØ·Ê¤È¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£
var blocks = [
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,...
[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4],
[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],
];¡¡
¤³¤ì¤ò¼ÂºÝ¤ËÇÛÃÖ¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
-game.preload('bear.gif', 'map2.gif'); ¤ÇÁǺà²èÁü¤òÆÉ¤ß¹þ¤à
-¼¡¤Î¥³¡¼¥É¤ÇÇØ·Ê¤ò»ØÄê
var map = new Map(16, 16);
map.image = game.assets['map2.gif'];
map.loadData(blocks);
-game.rootScene.addChild(map); ¤Ç¡¢ºÇ¸å¤ËÅÐÏ¿
**¥µ¥ó¥×¥ë [#b332014e]
-[[¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë:http://www.catch.jp/progr...
-ÇØ·Ê¤¬É½¼¨¤µ¤ì¡¢º¸±¦¤ÎÌð°õ¥¡¼¤Ç¥¯¥Þ¤¬Áö¤ê¤Þ¤¹¡£
-[[¥½¡¼¥¹¥³¡¼¥É:http://www.catch.jp/program/enchant.js/le...
¤³¤³¤Þ¤Ç¤Ç´°À®¤·¤¿¥Õ¥¡¥¤¥ë
#ref(enchant_sample_lesson3.lzh)
*nakamura001 ¥µ¥ó¥×¥ë½¸ [#z2822510]
¤³¤³¤Þ¤Ç¡¢¥·¥³¥·¥³¤Èenchant.js¤Î¥µ¥ó¥×¥ë¤òºî¤Ã¤Æ¤¤¿¤é¡¢...
-[[nakamura001 @ ¥¦¥£¥ - ¥È¥Ã¥×¥Ú¡¼¥¸/JavaScript¥²¡¼¥à/...
-¥¥ã¥é¥¯¥¿¡¼¤ò±¦¤Ë°Üư [[¥½¡¼¥¹:http://tsuyobi.heteml.jp...
-¥¥ã¥é¥¯¥¿¡¼¤òÊý¸þ¥¡¼¤Ç°Üư [[¥½¡¼¥¹:http://tsuyobi.het...
-±ýÉü°Üư½èÍý(¥¥ã¥é¥¯¥¿¡¼¤Î²èÁüȿž) [[²òÀâ:http://d.hat...
-¥¿¥Ã¥×¤·¤¿°ÌÃ֤˥¥ã¥é¥¯¥¿¡¼¤ò°Üư [[¥½¡¼¥¹:http://tsuyo...
-¥é¥Ù¥ë¤Îɽ¼¨ [[¥½¡¼¥¹:http://tsuyobi.heteml.jp/html/java...
-Åö¤¿¤êȽÄê(¥é¥¤¥Ö¥é¥ê¤Î¥á¥½¥Ã¥É¤ò»È¤ï¤º¤Ë¼«Á°¤ÇȽÄê) [[...
-Åö¤¿¤êȽÄê(¥é¥¤¥Ö¥é¥ê¤Î¥á¥½¥Ã¥É¤ÇȽÄê) [[¥½¡¼¥¹:http://t...
-¥¥ã¥é¥¯¥¿¡¼¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÊýË¡ [[²òÀâ:http://d.hatena....
-¥¥ã¥é¥¯¥¿¡¼¤ÎÄɲÃÊýË¡ [[²òÀâ:http://d.hatena.ne.jp/naka...
-¼Ö¤Î°Üư½èÍý [[²òÀâ:http://d.hatena.ne.jp/nakamura001/20...
-¥ì¥¤¥ä¡¼¤ÎÁ°¸å´Ø·¸¤ò¹Íθ¤·¤¿¥¥ã¥é¥¯¥¿¡¼ÄɲÃÊýË¡ [[²òÀâ:...
-ÊüʪÀþ¾õ¤Ëʪ¤òÅꤲ¤ëÊýË¡ [[²òÀâ:http://d.hatena.ne.jp/na...
*git [#ecca0cf8]
-[[ycatch/test_enchant.js - GitHub:https://github.com/yca...
¥Ú¡¼¥¸Ì¾: