fix bug with signs for players
This commit is contained in:
parent
4addf2696a
commit
fdb5637e3b
13
js/main.js
13
js/main.js
@ -34,12 +34,16 @@ socket.on('getmap', function (conent) {
|
|||||||
socket.on('objAction', function (obj) {
|
socket.on('objAction', function (obj) {
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
var mapX = obj["mapX"]*32;
|
var mapX = obj["mapX"]*32;
|
||||||
var mapY = obj["mapY"]*32;
|
var mapY = obj["mapY"]*32+3;
|
||||||
$(".overlay").remove();
|
$(".overlay"+obj["socketId"]).remove();
|
||||||
$("#main").append('<div class="overlay" id="" style="background: rgba(206, 0, 104, 0.45); width:32px; height:32px; z-index:2; position:absolute; top:'+mapY+'px; left:'+mapX+'px;"></div>');
|
$("#main").append('<div class="overlay'+obj["socketId"]+'" id="" style="background: rgba(206, 0, 104, 0.45); width:32px; height:32px; z-index:2; position:absolute; top:'+mapY+'px; left:'+mapX+'px;"></div>');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on('stopAction', function (socketId) {
|
||||||
|
$(".overlay"+socketId).remove();
|
||||||
|
});
|
||||||
|
|
||||||
socket.on('removeUtil', function (obj) {
|
socket.on('removeUtil', function (obj) {
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
$("."+obj["mapY"]+'-'+obj["mapX"]+'.'+obj["name"]).remove();
|
$("."+obj["mapY"]+'-'+obj["mapX"]+'.'+obj["name"]).remove();
|
||||||
@ -214,9 +218,6 @@ $(document).ready(function() {
|
|||||||
$( document ).keyup(function( event ) {
|
$( document ).keyup(function( event ) {
|
||||||
var key = event.which;
|
var key = event.which;
|
||||||
socket.emit("keyUp", key );
|
socket.emit("keyUp", key );
|
||||||
if(key==32) {
|
|
||||||
$(".overlay").remove();
|
|
||||||
}
|
|
||||||
keys[key] = false;
|
keys[key] = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user