mirror of
https://github.com/danbulant/slightlyComplicatedTicTacToe
synced 2026-05-24 12:22:12 +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() {
|
function decreaseLives() {
|
||||||
$connection!.setLives($gameData!.lives - 1);
|
$connection!.setLives($gameData!.lives - 1);
|
||||||
}
|
}
|
||||||
|
function keydown(e: KeyboardEvent) {
|
||||||
|
if(e.key === "KeyT") {
|
||||||
|
increaseScore();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window on:resize={resize} />
|
<svelte:window on:resize={resize} on:keydown={keydown}/>
|
||||||
|
|
||||||
|
|
||||||
<canvas bind:this={canvas} on:click={increaseScore} on:contextmenu={decreaseLives} />
|
<canvas bind:this={canvas} on:click={increaseScore} on:contextmenu={decreaseLives} />
|
||||||
Loading…
Reference in a new issue