var game = new Phaser.Game(256, 240, Phaser.AUTO, '', { preload: preload, init: init, create: create, update: update })

function preload() {
  game.load.spritesheet('guy', 'assets/guy.png', 17, 26)
  game.load.image('tileset', 'assets/tileset.png')
  game.load.tilemap('tilemap', 'assets/tilemap.csv')
}

function init() {
  game.scale.scaleMode = Phaser.ScaleManager.USER_SCALE;
  game.scale.setUserScale(2, 2);
  game.renderer.renderSession.roundPixels = true;
  Phaser.Canvas.setImageRenderingCrisp(this.game.canvas);
}

var player;
var map;
var layer;

function create() {
  game.stage.backgroundColor = '#99cccc';
  game.world.resize(2048, 1024);
  game.physics.startSystem(Phaser.Physics.ARCADE);
  map = game.add.tilemap('tilemap', 16, 16)
  map.addTilesetImage('tileset');
  layer = map.createLayer(0);
  map.setCollisionByExclusion([15, 16], true, layer);
  player = game.add.sprite(0, 0, 'guy');
  player.animations.add('right', [0, 1], 10, true);
  player.animations.add('left', [2, 3], 10, true);
  game.physics.enable(player);
  player.body.gravity.y = 600;
  player.body.collideWorldBounds = true;
}

var currX;
var currY;

function update() {
  game.physics.arcade.collide(player, layer);
  game.camera.follow(player);
  cursors = game.input.keyboard.createCursorKeys();
  player.body.velocity.x = 0;
  player.body.position.y = Math.round(player.body.position.y);
  if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
    player.animations.play('right');
    player.body.velocity.x += 200;
  } else if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
    player.animations.play('left');
    player.body.velocity.x -= 200;
  } else {
    player.animations.stop(null, true);
  }
  if (game.input.keyboard.isDown(Phaser.Keyboard.UP) && player.body.blocked.down) {
    player.body.velocity.y -= 350;
  }
}
@@ -25,15 +25,17 @@
 me(2
-56, 
+048, 10
 24
-0
 , Ph
@@ -194,16 +194,70 @@
 17, 26)%0A
+%0A  game.load.image('ladybug', 'assets/ladybug.png');%0A%0A
   game.l
@@ -605,16 +605,30 @@
 r layer;
+%0Avar ladybugs;
 %0A%0Afuncti
@@ -637,24 +637,179 @@
  create() %7B%0A
+%0A  ladybugs = game.add.group();%0A%0A  for (var i = 0; i %3C 10; i++) %7B%0A    ladybugs.create(1 + Math.random() * 400, 120 + Math.random() * 400, 'ladybug');%0A  %7D%0A%0A
   game.stage
@@ -839,16 +839,19 @@
 cccc';%0A 
+ //
  game.wo
@@ -1338,53 +1338,360 @@
 ue;%0A
-%7D%0A%0Avar currX;%0Avar currY;%0A%0Afunction update() %7B
+%0A  ladybugs.forEach(function(ladybug) %7B%0A    game.physics.enable(ladybug);%0A    ladybug.body.collideWorldBounds = true;%0A    ladybug.body.gravity.y = 600;%0A    ladybug.body.velocity.x = -40;%0A  %7D);%0A%7D%0A%0A%0Avar updateCount = 0;%0A%0Afunction update() %7B%0A%0A  updateCount++;%0A%0A  ladybugs.forEach(function(ladybug) %7B%0A    game.physics.arcade.collide(ladybug, layer);%0A  %7D);%0A
 %0A  g
@@ -2354,8 +2354,9 @@
 0;%0A  %7D%0A%7D
+%0A

add ladybug group that is broken