patch chat and game invite
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user