multiplayer fixes

This commit is contained in:
catarrh committed 2026-07-31 23:55:43 +03:00
1 parent 99d82d8fdf
commit 5fd4c1bd15
13 files changed
+53 -45

No files matched your search

+5 -1
View File
@@ -1,4 +1,4 @@
import {DEFAULT_KEYPRESS_DELAY, Z} from './constants.js?v=21';
import {DEFAULT_KEYPRESS_DELAY, Z} from './constants.js?v=22';
const input = {};
let lastKeypressTime = 0;
@@ -14,6 +14,10 @@ export function key(key) {
return input[key]
}
export function clearKeys() {
for (const k in input) input[k] = false;
}
export function afterKeyDelay(amount=DEFAULT_KEYPRESS_DELAY) {
const now = Date.now();
if (now - lastKeypressTime >= amount) {