collision algo with Hugo

+ ball.dir added to EventGameUpdate
This commit is contained in:
LuckyLaszlo
2022-11-25 14:54:17 +01:00
parent 3474d54a2b
commit 4aafbac1a5
6 changed files with 93 additions and 37 deletions

View File

@@ -26,9 +26,19 @@ class EventMatchmakingComplete extends ServerEvent {
}
class EventGameUpdate extends ServerEvent {
playerLeft = {y: 0};
playerRight = {y: 0};
ball = {x: 0, y: 0, speed: 0};
playerLeft = {
y: 0
};
playerRight = {
y: 0
};
ball = {
x: 0,
y: 0,
dirX: 0,
dirY: 0,
speed: 0
};
lastInputId = 0;
constructor() { // TODO: constructor that take GameComponentsServer maybe ?
super(en.EventTypes.gameUpdate);