Skip to content

Commit

Permalink
attempt to resolve white space issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanamisra committed Jun 27, 2024
1 parent 5e34ee7 commit 0b731d5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/Scoreboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default class Scoreboard {
p.image(this.boardImage, 0, 0, this.w, this.h);
p.fill("rgb(255, 255, 255)");
p.textSize(40);
if(p.windowWidth < 350)
p.textSize(28);
if(p.windowWidth < 400)
p.textSize(30);
p.textStyle(p.BOLD);
p.textFont('Pixelify Sans Variable');
p.text(`Hits: ${score}`, this.x + 10, this.y + 10, this.w, this.h);
Expand Down
16 changes: 13 additions & 3 deletions src/pages/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ function Game() {
monsterImages.push(await p.loadImage(zombie));
monsterImages.push(await p.loadImage(goblin));
monsterImages.push(await p.loadImage(vampire));
score = 0;
timer = 42;
}

p.setup = function() {
Expand Down Expand Up @@ -178,7 +176,19 @@ function Game() {
// }
}
}

(function()
{
if( window.localStorage )
{
if( !localStorage.getItem('firstLoad') )
{
localStorage['firstLoad'] = true;
window.location.reload();
}
else
localStorage.removeItem('firstLoad');
}
})();

useEffect(() => {
const p5Instance = new p5(sketch, p5Container.current);
Expand Down
1 change: 0 additions & 1 deletion src/pages/GameOver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const GameOver = () => {

const handlePlayGame = () => {
navigate("/game");
window.location.reload();
}

return (
Expand Down
6 changes: 6 additions & 0 deletions src/pages/Pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
}
}

/*GAME PAGE STYLING*/

.container {
overflow: hidden;
}

/*GAME OVER PAGE STYLING*/

.game-over-container {
Expand Down

0 comments on commit 0b731d5

Please sign in to comment.