Forked from: enchantjs's animation.enchant.js サンプル View Diff (1) forked: animation.enchant.js サンプル teetteet Follow 2012-10-06 07:27:26 License: MIT License Fork0 Fav0 View689 Play Stop Reload Fullscreen Smart Phone Readme JavaScript 50 lines HTML 1 lines CSS 1 lines forked: animation.enchant.js サンプル animation-enchant-js enchant.js v0.4.0 // forked from enchantjs's "animation.enchant.js サンプル" http://jsdo.it/enchantjs/animation-sample enchant(); window.onload = function(){ game = new Game(320, 320); game.preload(); game.fps = 30; game.onload = function(){ sprites = []; for(var i = 0; i < 9; i++){ var sp = new AnimationSprite(16, 16); sp.backgroundColor = "red"; sp.x = 32; sp.y = 30 * i + 32; sprites.push(sp); game.rootScene.addChild(sp); } sprites[0].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.LINEAR); }); sprites[1].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.QUINT_EASEOUT); }); sprites[2].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.QUINT_EASEIN); }); sprites[3].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.QUINT_EASEINOUT); }); sprites[4].addEventListener("touchstart", function(){ this.animation.moveBy(20, 0, 10, enchant.Easing.QUINT_EASEINOUT).delay(30); this.animation.looped = true; }); sprites[5].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.BOUNCE_EASEOUT).moveBy(-200, 0, 60, enchant.Easing.BACK_EASEOUT); }); sprites[6].addEventListener("touchstart", function(){ this.animation.fadeOut(30).delay(30).fadeIn(30); }); sprites[7].addEventListener("touchstart", function(){ this.animation.scaleTo(3, 30, enchant.Easing.BOUNCE_EASEOUT).scaleTo(1, 60); }); sprites[8].addEventListener("touchstart", function(){ this.animation.rotateBy(720, 300, enchant.Easing.QUINT_EASEOUT); }); } game.start(); } <canvas id='world'></canvas> forked: animation.enchant.js サンプル body { background-color: #DDDDDD; font: 30px sans-serif; } // forked from enchantjs's "animation.enchant.js サンプル" http://jsdo.it/enchantjs/animation-sample enchant(); window.onload = function(){ game = new Game(320, 320); game.preload(); game.fps = 30; game.onload = function(){ sprites = []; for(var i = 0; i < 9; i++){ var sp = new AnimationSprite(16, 16); sp.backgroundColor = "red"; sp.x = 32; sp.y = 30 * i + 32; sprites.push(sp); game.rootScene.addChild(sp); } sprites[0].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.LINEAR); }); sprites[1].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.QUINT_EASEOUT); }); sprites[2].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.QUINT_EASEIN); }); sprites[3].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.QUINT_EASEINOUT); }); sprites[4].addEventListener("touchstart", function(){ this.animation.moveBy(20, 0, 10, enchant.Easing.QUINT_EASEINOUT).delay(30); this.animation.looped = true; }); sprites[5].addEventListener("touchstart", function(){ this.animation.moveBy(200, 0, 60, enchant.Easing.BOUNCE_EASEOUT).moveBy(-200, 0, 60, enchant.Easing.BACK_EASEOUT); }); sprites[6].addEventListener("touchstart", function(){ this.animation.fadeOut(30).delay(30).fadeIn(30); }); sprites[7].addEventListener("touchstart", function(){ this.animation.scaleTo(3, 30, enchant.Easing.BOUNCE_EASEOUT).scaleTo(1, 60); }); sprites[8].addEventListener("touchstart", function(){ this.animation.rotateBy(720, 300, enchant.Easing.QUINT_EASEOUT); }); } game.start(); } <canvas id='world'></canvas> body { background-color: #DDDDDD; font: 30px sans-serif; } use an iframe compat browser, deer Play on jsdo.it games Author Share ブログに埋め込む QR Tag Download Complete! Description What kind of game? Control Device Smartphone Controllerjsdo.it WebSocket Controller» Mouse Keyboard Touch Device Fullscreen Activated Inactivated jsdo.it games から削除する Submit Author teetteet Tweet Default Panel Auto play Screenshot Readme JavaScript HTML CSS Size Width: px Height: px code <script type="text/javascript" src="http://jsdo.it/blogparts/cusw/js"></script> enchant.js game html5_elements&api library&test Discussion Questions on this code? Tags enchant.js game html5_elements&api library&test