mirror of
https://github.com/danbulant/slightlyComplicatedTicTacToe
synced 2026-05-19 04:08:52 +00:00
keydown test
This commit is contained in:
parent
f4c135cf5b
commit
62fa17b953
1 changed files with 6 additions and 1 deletions
|
|
@ -20,9 +20,14 @@
|
|||
function decreaseLives() {
|
||||
$connection!.setLives($gameData!.lives - 1);
|
||||
}
|
||||
function keydown(e: KeyboardEvent) {
|
||||
if(e.key === "KeyT") {
|
||||
increaseScore();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window on:resize={resize} />
|
||||
<svelte:window on:resize={resize} on:keydown={keydown}/>
|
||||
|
||||
|
||||
<canvas bind:this={canvas} on:click={increaseScore} on:contextmenu={decreaseLives} />
|
||||
Loading…
Reference in a new issue