some upd
This commit is contained in:
parent
c07b46ff8f
commit
75eaf59c79
3 changed files with 9 additions and 8 deletions
|
@ -1 +1,3 @@
|
|||
# cubicjs
|
||||
|
||||
https://meex.lol/cubic/
|
11
script.js
11
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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue