WIP multiBalls (need refactoring)

This commit is contained in:
LuckyLaszlo
2022-12-01 15:55:40 +01:00
parent 6e572f2fb5
commit c8c3111ed4
11 changed files with 132 additions and 45 deletions

View File

@@ -93,6 +93,17 @@ function gameUpdate(data: ev.EventGameUpdate)
gc.ball.pos.assign(data.ball.x, data.ball.y);
gc.ball.dir.assign(data.ball.dirX, data.ball.dirY);
gc.ball.speed = data.ball.speed;
if (c.optionsPLACEHOLDER & en.MatchOptions.multiBalls)
{ // ALTERNATIVE POSSIBLE, Array of balls
gc.ball2.pos.assign(data.ball2.x, data.ball2.y);
gc.ball2.dir.assign(data.ball2.dirX, data.ball2.dirY);
gc.ball2.speed = data.ball2.speed;
gc.ball3.pos.assign(data.ball3.x, data.ball3.y);
gc.ball3.dir.assign(data.ball3.dirX, data.ball3.dirY);
gc.ball3.speed = data.ball3.speed;
}
const predictionPos = new VectorInteger(clientInfo.racket.pos.x, clientInfo.racket.pos.y); // debug