finish oriented edits; no gen after finish, no camera movement after finish

This commit is contained in:
Mottributo 2023-03-23 17:49:32 +03:00
parent fd4cb23182
commit 96340d0984

View File

@ -156,13 +156,15 @@ function startGame(full_start, update_objects) {
width: 50,
points: [],
};
} else
} else {
if (canyons[i - 1].x + 600 > finish_position_x) break;
canyons[i] = {
x: canyons[i - 1].x + 300 + 200 * random(0.5, 1),
width: 50 + 30 * random(),
points: [],
};
}
}
for (i = 0; i < 100; i++) {
if (i == 0) {
collectables[0] = {
@ -171,17 +173,21 @@ function startGame(full_start, update_objects) {
size: 75,
isFound: false,
};
} else
} else {
if (collectables[i - 1].x + 200 > finish_position_x) {
break;
}
collectables[i] = {
x: collectables[i - 1].x + 50 + 150 * random(0.5, 1),
x: collectables[i - 1].x + 50 + 100 * random(0.5, 1),
y: gameChar.possibleGroundPosY[
ceil(random(0, gameChar.possibleGroundPosY.length))
floor(random(0, gameChar.possibleGroundPosY.length))
],
size: 75,
isFound: false,
};
}
}
}
flagpole = {
x: finish_position_x,
isReached: false,
@ -205,7 +211,7 @@ function draw() {
fill(0);
translate(-cameraPosX, 0); // Scrolling
cameraPosX = gameChar.x - width / 2; // Scrolling
if (gameChar.x < finish_position_x) cameraPosX = gameChar.x - width / 2; // Scrolling
// -------- CLOUDS --------------
drawClouds();
@ -512,7 +518,7 @@ function drawGround() {
);
stroke(1);
translate(-cameraPosX, 0);
for (i = 0; i < finish_position_x; i += 20) {
for (i = -width/2; i < finish_position_x + width/2; i += 20) {
line(
i,
floorPos_y + (2 * (height - floorPos_y)) / 6,