add erdhaufen

This commit is contained in:
Raphael 2024-12-05 17:16:43 +01:00
parent 00da94c4a1
commit 7c25a1ec0d
5 changed files with 8 additions and 4 deletions

View File

@ -552,11 +552,11 @@
} }
.sandhaufen { .sandhaufen {
background: url(../img/ground_tiles.png) 173px -11px; background: url(../img/ground_tiles.png) 125px -121px;
} }
.erdhaufen { .erdhaufen {
background: url(../img/ground_tiles.png) 173px -11px; background: url(../img/ground_tiles.png) 125px -197px;
} }
.water_1 { .water_1 {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 244 KiB

BIN
img/ground_tiles_save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View File

@ -96,7 +96,7 @@ socket.on('animation', function (timer) {
socket.on('replaceFloor', function (content) { 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"]; cssMap[content["y"]][content["x"]] = content["newFloor"];
console.log(content) console.log(content)
}); });

View File

@ -331,10 +331,14 @@ io.on('connection', function (socket) {
} }
io.sockets.emit("dropItem", newObj); io.sockets.emit("dropItem", newObj);
let newFloor = "sandhaufen";
if(map[y][x] == 6) {
newFloor = "erdhaufen";
}
io.sockets.emit("replaceFloor", { io.sockets.emit("replaceFloor", {
x: x, x: x,
y: y, y: y,
newFloor: "sandhaufen" newFloor: newFloor
}); });
cssMap[y][x] = "sandhaufen"; cssMap[y][x] = "sandhaufen";