make actuator properly create html elements

This commit is contained in:
Gabriele Cirulli
2014-03-08 13:32:37 +01:00
parent dca5207fa4
commit b7476f1f62
3 changed files with 34 additions and 20 deletions
+3 -1
View File
@@ -25,7 +25,9 @@ GameManager.prototype.addStartTiles = function () {
// Adds a tile in a random position
GameManager.prototype.addRandomTile = function () {
var tile = new Tile(this.grid.randomAvailableCell());
var value = Math.random() < 0.9 ? 2 : 4;
var tile = new Tile(this.grid.randomAvailableCell(), value);
this.grid.insertTile(tile);
};