multiplayer fixes
This commit is contained in:
1 parent
99d82d8fdf
commit
5fd4c1bd15
13 files changed
+53
-45
No files matched your search
+5
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user