added alternate game mode "movingWalls"

This commit is contained in:
LuckyLaszlo
2022-12-02 21:01:06 +01:00
parent 93a40f2ad9
commit 59c7ae2a16
13 changed files with 136 additions and 24 deletions

View File

@@ -2,6 +2,7 @@
import * as c from "./constants.js";
import * as en from "../shared_js/enums.js"
import { gc, clientInfo } from "./global.js";
import { wallsMovements } from "../shared_js/wallsMovement.js";
let actual_time: number = Date.now();
let last_time: number;
@@ -26,6 +27,10 @@ function gameLoop()
gc.ballsArr.forEach((ball) => {
ball.moveAndBounce(delta_time, [gc.wallTop, gc.wallBottom, gc.playerLeft, gc.playerRight]);
});
if (c.optionsPLACEHOLDER & en.MatchOptions.movingWalls) {
wallsMovements(delta_time, gc);
}
}
function opponentInterpolation(delta: number)