Code review 2023-01-10

This commit is contained in:
s-prechtl 2023-01-10 08:45:34 +01:00
parent d748312d66
commit 637a867c7e
9 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,4 @@
// TODO: Refactor
const pipeImagePath: string = "resources/raspberry-low-res.png";
const obstacleWidth: number = 88;
let obstacleOffset: number;
@ -33,6 +34,7 @@ function setupGame() {
raspberry.image = raspberryImagePath;
// Create all obstacles
// TODO: Loop
obstacles = [];
obstacles.push(new Obstacle(
new Position(width, 0),
@ -57,6 +59,7 @@ function setupGame() {
obstacles.forEach((obstacle) => obstacle.randomizeHeight());
}
// TODO: Split into funciton
function draw() {
background(backgroundImage)
if (!paused) {