walls.children.forEach(function(wall) { wall.body.immovable = true; });
gems = game.add.group();
- for (var i = 0; i <= MAX_GEMS; i++)
+ for (var i = 0; i < MAX_GEMS; i++)
gems.add(new Gem((Math.random() * (game.world.width - (WALL_THICKNESS * 4))) + (WALL_THICKNESS * 2), (Math.random() * (game.world.height - (WALL_THICKNESS * 4))) + (WALL_THICKNESS * 2)));
gems.children.forEach(function(gem) { gem.enablePhysics(); });