if (game.input.up){ this.scaleX += 0.1; this.scaleY += 0.1; }
if (game.input.down){ this.scaleX -= 0.1; this.scaleY -= 0.1; }
if (game.input.left){ this.rotation -= 10; }
if (game.input.right){ this.rotation += 10; }
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
enchant(); window.onload = function(){ var game = new Game(400, 300); game.preload("character2.png"); game.fps = 20; game.onload = function(){ var char1 = new Sprite(100, 100); char1.image = game.assets["character2.png"]; char1.x = 150; char1.y = 100; char1.addEventListener(enchant.Event.ENTER_FRAME, function(){ this.frame = this.age % 2; if (game.input.up){ this.scaleX += 0.1; this.scaleY += 0.1; } if (game.input.down){ this.scaleX -= 0.1; this.scaleY -= 0.1; } if (game.input.left){ this.rotation -= 10; } if (game.input.right){ this.rotation += 10; } }); game.rootScene.backgroundColor = "#ffaaaa"; game.rootScene.addChild(char1); }; game.start(); };
<< 前へ |