This commit is contained in:
MeexReay 2024-12-15 23:55:15 +03:00
parent c07b46ff8f
commit 75eaf59c79
3 changed files with 9 additions and 8 deletions

View file

@ -1 +1,3 @@
# cubicjs
https://meex.lol/cubic/

View file

@ -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)

View file

@ -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):