diff --git a/css/main.css b/css/main.css index d65d1ee..6b24ccb 100644 --- a/css/main.css +++ b/css/main.css @@ -552,11 +552,11 @@ } .sandhaufen { - background: url(../img/ground_tiles.png) 173px -11px; + background: url(../img/ground_tiles.png) 125px -121px; } .erdhaufen { - background: url(../img/ground_tiles.png) 173px -11px; + background: url(../img/ground_tiles.png) 125px -197px; } .water_1 { diff --git a/img/ground_tiles.png b/img/ground_tiles.png index 2216989..d38693a 100644 Binary files a/img/ground_tiles.png and b/img/ground_tiles.png differ diff --git a/img/ground_tiles_save.png b/img/ground_tiles_save.png new file mode 100644 index 0000000..2216989 Binary files /dev/null and b/img/ground_tiles_save.png differ diff --git a/js/main.js b/js/main.js index 76bad1e..bdc0c2e 100644 --- a/js/main.js +++ b/js/main.js @@ -96,7 +96,7 @@ socket.on('animation', function (timer) { socket.on('replaceFloor', function (content) { - $("." + content["y"] + '-' + content["x"]+'.sprite').removeClass("ground").addClass(content["newFloor"]); + $("." + content["y"] + '-' + content["x"]+'.sprite').removeClass("ground").removeClass("grass").addClass(content["newFloor"]); cssMap[content["y"]][content["x"]] = content["newFloor"]; console.log(content) }); diff --git a/server.js b/server.js index cf24b6b..8785102 100644 --- a/server.js +++ b/server.js @@ -331,10 +331,14 @@ io.on('connection', function (socket) { } io.sockets.emit("dropItem", newObj); + let newFloor = "sandhaufen"; + if(map[y][x] == 6) { + newFloor = "erdhaufen"; + } io.sockets.emit("replaceFloor", { x: x, y: y, - newFloor: "sandhaufen" + newFloor: newFloor }); cssMap[y][x] = "sandhaufen";