multiBalls refactoring with ballsArr[]
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user