statki/public/assets/js/key-handling.js
MaciejkaG dbb3ad0f1d Major changes
- Players can now successfully get into a game
- None of the game view features don't work yet
- Optimisation changes
- Improved file naming
- A game will automatically end if either of the players disconnect
- Players will start the game synchronously as the server will wait for both of them to connect
- Timer and game state updating works really well
2024-03-02 13:56:01 +01:00

13 lines
282 B
JavaScript

document.addEventListener("keydown", (e) => {
switch (e.code) {
case "KeyB":
switchBoards();
break;
case "KeyS":
switchShips();
break;
case "KeyR":
switchRotation();
break;
}
});