multiBalls refactoring with ballsArr[]

This commit is contained in:
LuckyLaszlo
2022-12-01 17:48:34 +01:00
parent c8c3111ed4
commit f73932c131
9 changed files with 97 additions and 121 deletions

View File

@@ -23,12 +23,9 @@ function gameLoop()
}
// client prediction
gc.ball.moveAndBounce(delta_time, [gc.wallTop, gc.wallBottom, gc.playerLeft, gc.playerRight]);
if (c.optionsPLACEHOLDER & en.MatchOptions.multiBalls)
{ // ALTERNATIVE POSSIBLE, Array of balls
gc.ball2.moveAndBounce(delta_time, [gc.wallTop, gc.wallBottom, gc.playerLeft, gc.playerRight]);
gc.ball3.moveAndBounce(delta_time, [gc.wallTop, gc.wallBottom, gc.playerLeft, gc.playerRight]);
}
gc.ballsArr.forEach((ball) => {
ball.moveAndBounce(delta_time, [gc.wallTop, gc.wallBottom, gc.playerLeft, gc.playerRight]);
});
}
function opponentInterpolation(delta: number)