finish oriented edits; no gen after finish, no camera movement after finish
This commit is contained in:
parent
fd4cb23182
commit
96340d0984
18
sketch.js
18
sketch.js
@ -156,13 +156,15 @@ function startGame(full_start, update_objects) {
|
|||||||
width: 50,
|
width: 50,
|
||||||
points: [],
|
points: [],
|
||||||
};
|
};
|
||||||
} else
|
} else {
|
||||||
|
if (canyons[i - 1].x + 600 > finish_position_x) break;
|
||||||
canyons[i] = {
|
canyons[i] = {
|
||||||
x: canyons[i - 1].x + 300 + 200 * random(0.5, 1),
|
x: canyons[i - 1].x + 300 + 200 * random(0.5, 1),
|
||||||
width: 50 + 30 * random(),
|
width: 50 + 30 * random(),
|
||||||
points: [],
|
points: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (i = 0; i < 100; i++) {
|
for (i = 0; i < 100; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
collectables[0] = {
|
collectables[0] = {
|
||||||
@ -171,17 +173,21 @@ function startGame(full_start, update_objects) {
|
|||||||
size: 75,
|
size: 75,
|
||||||
isFound: false,
|
isFound: false,
|
||||||
};
|
};
|
||||||
} else
|
} else {
|
||||||
|
if (collectables[i - 1].x + 200 > finish_position_x) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
collectables[i] = {
|
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[
|
y: gameChar.possibleGroundPosY[
|
||||||
ceil(random(0, gameChar.possibleGroundPosY.length))
|
floor(random(0, gameChar.possibleGroundPosY.length))
|
||||||
],
|
],
|
||||||
size: 75,
|
size: 75,
|
||||||
isFound: false,
|
isFound: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
flagpole = {
|
flagpole = {
|
||||||
x: finish_position_x,
|
x: finish_position_x,
|
||||||
isReached: false,
|
isReached: false,
|
||||||
@ -205,7 +211,7 @@ function draw() {
|
|||||||
fill(0);
|
fill(0);
|
||||||
|
|
||||||
translate(-cameraPosX, 0); // Scrolling
|
translate(-cameraPosX, 0); // Scrolling
|
||||||
cameraPosX = gameChar.x - width / 2; // Scrolling
|
if (gameChar.x < finish_position_x) cameraPosX = gameChar.x - width / 2; // Scrolling
|
||||||
|
|
||||||
// -------- CLOUDS --------------
|
// -------- CLOUDS --------------
|
||||||
drawClouds();
|
drawClouds();
|
||||||
@ -512,7 +518,7 @@ function drawGround() {
|
|||||||
);
|
);
|
||||||
stroke(1);
|
stroke(1);
|
||||||
translate(-cameraPosX, 0);
|
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(
|
line(
|
||||||
i,
|
i,
|
||||||
floorPos_y + (2 * (height - floorPos_y)) / 6,
|
floorPos_y + (2 * (height - floorPos_y)) / 6,
|
||||||
|
Loading…
Reference in New Issue
Block a user