text size fix

This commit is contained in:
Mottributo 2023-03-26 20:51:36 +03:00
parent bd6c575677
commit 2f832bd2e6

View File

@ -447,6 +447,7 @@ function setup() {
}
function startGame(level_start) {
floorPos_y = 432;
text_size = sqrt(width) + sqrt(height);
// levels of depth where the character, collectable and enemies stand.
groundPositions = [
floorPos_y + (height - floorPos_y) / 6,
@ -1064,7 +1065,6 @@ function drawFps() {
pop();
}
function keyPressed() {
console.log(frameCount + ' pressed ' + key + ' ' + keyCode);
if (gameChar.curLives < 1 || flagpole.isReached) {
if (keyCode == 32 /*Space*/) {
/*Hard resets the game*/
@ -1092,7 +1092,6 @@ function keyPressed() {
if (keyCode == 78 /*N*/) shadows_enabled = !shadows_enabled;
}
function keyReleased() {
console.log(frameCount + ' released ' + key + ' ' + keyCode);
if (keyCode == 65 /*A*/ || keyCode == LEFT_ARROW) gameChar.isLeft = false;
if (keyCode == 68 /*D*/ || keyCode == RIGHT_ARROW) gameChar.isRight = false;
}