minor formatting

This commit is contained in:
Mottributo 2023-03-23 17:22:33 +03:00
parent 07901202bf
commit fd4cb23182

View File

@ -291,10 +291,10 @@ function draw() {
else if (flagpole.isReached) else if (flagpole.isReached)
text("Level complete. Press space to continue...", 0, height / 2); text("Level complete. Press space to continue...", 0, height / 2);
if (showDebugData) { if (showDebugData) {
text(gameChar.curGroundPosYIndex, 99, 99); text(gameChar.curGroundPosYIndex, 99, 99);
text(gameChar.getCurGroundPosY(), 188, 99); text(gameChar.getCurGroundPosY(), 188, 99);
text(gameChar.sprite, 277, 99); text(gameChar.sprite, 277, 99);
drawFps(); drawFps();
} }
pop(); pop();
} }
@ -585,7 +585,7 @@ function drawClouds() {
translate((frameCount / clouds[i].y) * 20, 0); // imitating clouds movement, upper ones should go faster translate((frameCount / clouds[i].y) * 20, 0); // imitating clouds movement, upper ones should go faster
// Adding counter-translating to implement parallax, the feeling of depth // Adding counter-translating to implement parallax, the feeling of depth
translate(cameraPosX / 1.1, 0); translate(cameraPosX / 1.1, 0);
noStroke(); noStroke();
fill(palette.cloud0); fill(palette.cloud0);
ellipse( ellipse(
@ -785,12 +785,10 @@ function checkPlayerDie() {
} }
function drawFps() { function drawFps() {
push(); push();
fps = Math.round(frameRate() * 10) / 10;
fps = Math.round(frameRate() * 10) / 10; if (fps_recent_values.length < 200) fps_recent_values.push(fps);
if (fps_recent_values.length < 200) fps_recent_values.push(fps); else fps_recent_values.shift();
else fps_recent_values.shift(); fps_recent_values.push(fps);
fps_recent_values.push(fps);
fill("red"); fill("red");
text(fps, 400, 99); text(fps, 400, 99);
stroke("black"); stroke("black");