/** * Generated from the Phaser Sandbox * * //phaser.io/sandbox/zmRXIPjS * * This source requires Phaser 2.6.2 */ var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.baseURL = 'http://examples.phaser.io/assets/'; game.load.crossOrigin = 'anonymous'; game.load.image('phaser', 'sprites/phaser-dude.png'); } function create() { var scale = 1; var screenGroup; screenGroup = game.add.group(); var sprite = game.add.sprite(0, 0, 'phaser'); screenGroup.add(sprite); var sprite2 = game.add.sprite(100, 100, 'phaser'); screenGroup.add(sprite2); var sprite3 = game.add.sprite(200, 200, 'phaser'); screenGroup.add(sprite3); var sprite4 = game.add.sprite(300, 300, 'phaser'); screenGroup.add(sprite4); game.input.onDown.add(function() { scale -= 0.1 screenGroup.scale.setTo(scale, scale); }, this); } function update() { } function render() { }