diff --git a/README.md b/README.md index 64bcd9a..87fb875 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # cubicjs + +https://meex.lol/cubic/ \ No newline at end of file diff --git a/script.js b/script.js index be92590..0a5907d 100644 --- a/script.js +++ b/script.js @@ -323,14 +323,14 @@ class MainPlayer extends Player { } } else { if (key == "KeyD") { - this.controls_x = 1 this.send_packet("C","W","2") + this.controls_x = 1 } else if (key == "KeyA") { - this.controls_x = -1 this.send_packet("C","W","1") + this.controls_x = -1 } else if (key == "Space") { - this.controls_jump = true this.send_packet("C","J","1") + this.controls_jump = true e.preventDefault() return false } else if (key == "KeyR") { @@ -367,11 +367,11 @@ class MainPlayer extends Player { if ((key == "KeyD" && this.controls_x == 1) || (key == "KeyA" && this.controls_x == -1)) { - this.controls_x = 0 this.send_packet("C","W","0") + this.controls_x = 0 } else if (key == "Space" && this.controls_jump) { - this.controls_jump = false this.send_packet("C","J","0") + this.controls_jump = false } if (allowed_key_to_send.includes(key)) { @@ -572,7 +572,6 @@ class MainPlayer extends Player { ctx.fillText("camera.y: "+camera.y, 0, 120); } - if (!chatOpened) { ctx.fillStyle = "#22222288" ctx.fillRect(5, height - 35, width * 0.4, 30) diff --git a/server.py b/server.py index 7b610fc..fd06318 100644 --- a/server.py +++ b/server.py @@ -1,5 +1,5 @@ -from websockets.asyncio.server import serve, ServerConnection -import threading, random, sys, asyncio +from websockets.server import serve, ServerConnection +import random, sys, asyncio class Block: def __init__(self, x, y, block_type, color, collides):