|
|
|
@ -25,23 +25,9 @@ Game = {
|
|
|
|
|
var at_edge = x == 0 || x == Game.map_grid.width - 1 || y == 0 || y == Game.map_grid.height - 1;
|
|
|
|
|
|
|
|
|
|
if (at_edge) {
|
|
|
|
|
Crafty.e('2D, Canvas, Color')
|
|
|
|
|
.attr({
|
|
|
|
|
x: x * Game.map_grid.tile.width,
|
|
|
|
|
y: y * Game.map_grid.tile.height,
|
|
|
|
|
w: Game.map_grid.tile.width,
|
|
|
|
|
h: Game.map_grid.tile.height
|
|
|
|
|
})
|
|
|
|
|
.color('rgb(20, 125, 40)');
|
|
|
|
|
Crafty.e('Tree').at(x, y);
|
|
|
|
|
} else if (Math.random() < 0.06) {
|
|
|
|
|
Crafty.e('2D, Canvas, Color')
|
|
|
|
|
.attr({
|
|
|
|
|
x: x * Game.map_grid.tile.width,
|
|
|
|
|
y: y * Game.map_grid.tile.height,
|
|
|
|
|
w: Game.map_grid.tile.width,
|
|
|
|
|
h: Game.map_grid.tile.height
|
|
|
|
|
})
|
|
|
|
|
.color('rgb(20, 185, 40)');
|
|
|
|
|
Crafty.e('Bush').at(x, y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|