Skip to content

Commit

Permalink
fix: spacebar starts game but doesn't hide popup
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcafe committed Dec 19, 2023
1 parent 4f8cafd commit b78c49e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div>Start game: <kbd>Spacebar</kbd></div>
<!-- <br> -->
<div>Restart game: <kbd>R</kbd></div>
<button id="fullscreen">Ready</button>
<button id="fullscreen">Start</button>
</div>
</div>
<style>
Expand Down Expand Up @@ -95,4 +95,4 @@
<script type="module" src="/src/index.ts">
</script>
</body>
</html>
</html>
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const fullscreen = $('#fullscreen') as HTMLButtonElement
fullscreen.onclick = () => {
const requestFullScreen = canvas.requestFullscreen //|| canvas.webkitRequestFullScreen
requestFullScreen.call(canvas)
game.paused = !game.paused
}

game.endMatch = function () {
Expand Down
3 changes: 2 additions & 1 deletion src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ export class Player {
}

start() {
game.paused = !game.paused
const fullscreen = document.querySelector('#fullscreen') as HTMLButtonElement
fullscreen.click()
}

restart() {
Expand Down

1 comment on commit b78c49e

@vercel
Copy link

@vercel vercel bot commented on b78c49e Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

becomb – ./

becomb-igoracmelo.vercel.app
becomb.vercel.app
becomb-git-master-igoracmelo.vercel.app

Please sign in to comment.