First commit of the day

This commit is contained in:
Webeled
2013-09-19 10:36:15 +02:00
parent c5fc5e3394
commit 6e4631a849
4 changed files with 44 additions and 13 deletions
+7 -3
View File
@@ -7,7 +7,7 @@
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create });
function preload() {
@@ -21,17 +21,21 @@
function create() {
// For browsers that support it, this keeps our pixel art looking crisp
//Phaser.Canvas.setSmoothingEnabled(game.stage.canvas.context, false);
// This only works when you use Phaser.CANVAS as the renderer
Phaser.Canvas.setSmoothingEnabled(game.context, false);
boss = game.add.sprite(game.world.centerX, game.world.centerY, 'boss');
boss.anchor.setTo(0.5, 0.5);
// Zoom in each time we press it
// Zoom in each time we press the button
button = game.add.button(32, 32, 'button', clickedIt, this, 2, 1, 0);
}
function clickedIt() {
boss.scale.x += 0.5;
boss.scale.y += 0.5;
}
})();