File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import SinglePlayer from "./nodes/SinglePlayer";
55import Multiplayer from "./nodes/Multiplayer" ;
66import Background from "./nodes/Background" ;
77import { initSounds } from "./audio" ;
8+ import { inputs } from "./inputs" ;
89
910export default class Game {
1011 async start ( ) {
@@ -22,6 +23,13 @@ export default class Game {
2223 // Append the application canvas to the document body
2324 document . getElementById ( "app" ) ! . appendChild ( app . canvas ) ;
2425
26+ // Button to manually refresh the app
27+ document . addEventListener ( "keydown" , ( e ) => {
28+ if ( e . key === inputs . refresh ) {
29+ window . location . reload ( ) ;
30+ }
31+ } ) ;
32+
2533 const background = new Background ( ) ;
2634
2735 const menu = new Menu ( background ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export interface PlayerInput {
77 hold : string ;
88}
99export const inputs = {
10+ refresh : "r" ,
1011 pause : "p" ,
1112 player1 : {
1213 left : "a" ,
You can’t perform that action at this time.
0 commit comments