add more map things
This commit is contained in:
parent
397ef5d6e4
commit
ad21fc81a0
18
css/main.css
18
css/main.css
@ -14,6 +14,24 @@
|
||||
background: url(../img/objectlayer.png) 125px -29px;;
|
||||
}
|
||||
|
||||
.tree1{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background: url(../img/objectlayer.png) 315px -70px;
|
||||
}
|
||||
|
||||
.stone1{
|
||||
width: 32px;
|
||||
height: 35px;
|
||||
background: url(../img/objectlayer.png) 158px -65px;
|
||||
}
|
||||
|
||||
.fass{
|
||||
width: 32px;
|
||||
height: 43px;
|
||||
background: url(../img/objectlayer.png) 157px -18px;
|
||||
}
|
||||
|
||||
.water {
|
||||
background: url(../img/ground_tiles.png) 192px 254px;
|
||||
}
|
||||
|
33
s_map.js
33
s_map.js
@ -2,31 +2,6 @@ module.exports = {
|
||||
generateMap: function(width, height) {
|
||||
var map = [];
|
||||
var utilMap = [];
|
||||
var i = 0;
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","4","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","4","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","4","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","4","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","4","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","4","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
map[i++] = ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"];
|
||||
|
||||
var g = [6,5,4,3,2];
|
||||
for(var k=0;k<g.length;k++) {
|
||||
@ -130,11 +105,17 @@ module.exports = {
|
||||
//Set ground type
|
||||
for(var w=0;w<width;w++) {
|
||||
for(var h=0;h<height;h++) {
|
||||
if(map[w][h] == "#") {
|
||||
if(map[w][h] == "#") { //is ground
|
||||
map[w][h] = "6"; //set ground
|
||||
|
||||
if(Math.random()<0.011) {
|
||||
utilMap[w][h] = "flower";
|
||||
} else if(Math.random()<0.011) {
|
||||
utilMap[w][h] = "tree1";
|
||||
} else if(Math.random()<0.011) {
|
||||
utilMap[w][h] = "stone1";
|
||||
} else if(Math.random()<0.011) {
|
||||
utilMap[w][h] = "fass";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user