Bag = function (game, boxes) {
    this.game = game
    this.tiles = []
    this.id = 0
    this.boxes = boxes

    var file = game.cache.getJSON('let')
    this.json = file.letters
}

Bag.prototype.fill = function () {
    for (var key in this.json)
	for( i = 0; i < this.json[key].tiles; ++i)
	    this.tiles.push({letter: key.toUpperCase(),
			     points: this.json[key].points})
}

Bag.prototype.getTile = function () {
    if( this.tiles.length < 1 )
	this.fill()

    return Phaser.ArrayUtils.removeRandomItem(this.tiles)
}

Bag.prototype.placeBox = function (x, y) {
    var tile = this.getTile()
    var box = new StandardBox(this.game, this.id++, tile, x, y)
    this.boxes.add(box)
    return box
}

Bag.prototype.getBox = function (karma) {

    // Super Nice boxes
    if ( karma > 17 )
	return new TripleBox(this.game, this.id++)
    else if ( karma > 12 )
	return new DoubleBox(this.game, this.id++)

    // Nice boxes
    var tile = this.getTile()
    if ( karma > 7 )
    	return new GoldBox(this.game, this.id++, tile)
    else if ( karma > 3 )
    	return new SilverBox(this.game, this.id++, tile)

    // Bad Boxes
    var dice = this.game.rnd.integer()%10
    if ( dice == 1)
	return new BombBox(this.game, this.id++, tile, this.boxes)
    else if (dice == 2)
    	return new BigBox(this.game, this.id++, tile)
    else if (dice == 3)
    	return new WideBox(this.game, this.id++, tile)
    else if (dice == 4)
	return new BallBox(this.game, this.id++, tile)
    else  // Standard Box
	return  new StandardBox(this.game, this.id++, tile)
}

Bag.prototype.dropBox = function (gameData) {

    var box = this.getBox(gameData.karma)

    this.boxes.add(box)
    return box
}

@@ -741,16 +741,82 @@
 on (
-karma) %7B
+gameData) %7B%0A%0A    var karma = gameData.karma%0A    var level = gameData.level
 %0A%0A  
@@ -1254,16 +1254,29 @@
 ice == 1
+ && level %3E 3
 )%0A%09retur
@@ -1355,83 +1355,21 @@
 == 2
-)%0A    %09return new BigBox(this.game, this.id++, tile)%0A    else if (dice == 3
+ && level %3E 2
 )%0A  
@@ -1443,9 +1443,22 @@
  == 
-4
+3 && level %3E 2
 )%0A%09r
@@ -1495,32 +1495,120 @@
 his.id++, tile)%0A
+    else if (dice == 4 && level %3E 1)%0A    %09return new BigBox(this.game, this.id++, tile)%0A
     else  // Sta
@@ -1712,32 +1712,32 @@
 n (gameData) %7B%0A%0A
+
     var box = th
@@ -1754,22 +1754,16 @@
 gameData
-.karma
 )%0A%0A    t

Change bad box drop rate