Joystick for mobile

This commit is contained in:
armel committed 2026-09-07 21:22:08 +02:00
1 parent e8c3f9862a
commit 54c6327ac7
4 files changed
+120 -3

No files matched your search

+3 -2
View File
@@ -46,6 +46,7 @@ window.addEventListener('orientationchange', resizeToWindow);
resizeToWindow();
const input = new Input(canvas, viewport);
const isMobile = input.isMobile;
const fullscreenButton = document.getElementById('fullscreen');
const updateFullscreenLabel = () => {
@@ -86,7 +87,7 @@ const updateCamera = (cx, cy) => {
camera.y = Math.min(Math.max(0, targetY), Math.max(0, WORLD_H - viewport.height));
};
let autoAim = false;
let autoAim = isMobile;
let muted = false;
let autoAimNotice = 0;
let muteNotice = 0;
@@ -977,7 +978,7 @@ const gameLoop = (now) => {
muted = sounds.toggleMuted();
muteNotice = 1.2;
}
if (input.pressed.has('q')) {
if (!isMobile && input.pressed.has('q')) {
input.clearPressed();
autoAim = !autoAim;
autoAimNotice = 1.2;