patch chat and game invite

This commit is contained in:
2024-05-15 09:53:44 +02:00
parent f4b7a50269
commit 1ad9d0897b
8 changed files with 33 additions and 27 deletions

View File

@ -280,6 +280,7 @@ class Game {
PADDLESPEED: 3,
BALLRADIUS: 5,
BALLSPEED: 2,
BALLMAXSPEED: 4,
BALLSPEEDINCR: 0.15,
MAXBOUNCEANGLE: 10 * (Math.PI / 12),
MAXSCORE: 2
@ -526,13 +527,13 @@ class Game {
let normRelIntersectY = relativeIntersectY / this.def.PADDLEHEIGHT / 2;
let bounceAngle = normRelIntersectY * this.def.MAXBOUNCEANGLE;
ball.speed += this.def.BALLSPEEDINCR;
ball.speed += ball.speed >= this.def.BALLMAXSPEED ? 0 : this.def.BALLSPEEDINCR;
ball.vx = ball.speed * side * Math.cos(bounceAngle);
ball.vy = ball.speed * -Math.sin(bounceAngle);
}
keyUpHandler(ev) {
let attributes = ev.originalTarget.attributes;
let attributes = ev.target.attributes;
let key = ev.key === undefined ? `${attributes.direction.value}${attributes.user_id.value}` : ev.key;
@ -542,7 +543,7 @@ class Game {
}
keyDownHandler(ev) {
let attributes = ev.originalTarget.attributes;
let attributes = ev.target.attributes;
let key = ev.key === undefined ? `${attributes.direction.value}${attributes.user_id.value}` : ev.key;