|
|
@ -52,7 +52,7 @@
|
|
52
|
52
|
var screen_pos = pixl.to_screen(pos);
|
|
53
|
53
|
pixl.ctx.fillRect(screen_pos.x, screen_pos.y, pixl.size, pixl.size);
|
|
54
|
54
|
pixl.world[pos.x + "," + pos.y] = {};
|
|
55
|
|
if (pixl.online) {
|
|
|
55
|
if (pixl.online && !pos.remote) {
|
|
56
|
56
|
pixl.ws.send(JSON.stringify([{x: pos.x, y: pos.y, color: color || "black"}]));
|
|
57
|
57
|
}
|
|
58
|
58
|
}
|
|
|
@ -151,6 +151,7 @@
|
|
151
|
151
|
var obj = JSON.parse(msg.data);
|
|
152
|
152
|
if (obj.length !== undefined) {
|
|
153
|
153
|
obj.forEach(function(p) {
|
|
|
154
|
p.remote = true;
|
|
154
|
155
|
pixl.world[p.x + "," + p.y] = {color: p.color};
|
|
155
|
156
|
pixl.draw_pixl(p, p.color);
|
|
156
|
157
|
});
|