From 77bcfd31969d43ef7ac8dce4fd4004a2681b499d Mon Sep 17 00:00:00 2001 From: Moonlit Productions Date: Mon, 17 Nov 2025 10:27:24 -0500 Subject: [PATCH] Fix joysticks not being visible by default on mobile --- script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index 15a0340..eae0e64 100644 --- a/script.js +++ b/script.js @@ -5,7 +5,7 @@ import GrahamScan from "./vendor/lucio/graham-scan.mjs"; class Joystick { - constructor(ctx, x, y, radius) { + constructor(ctx, x, y, radius, visibleByDefault) { this.ctx = ctx; this.x = x; this.y = y; @@ -13,7 +13,7 @@ class Joystick { this.nubX = x; this.nubY = y; this.active = false; - this.visible = false; + this.visible = visibleByDefault; } draw() { @@ -892,8 +892,8 @@ function updateModuleDisplays(robot) { * BEGIN ANIMATION CODE */ -const leftJoystick = new Joystick(ctx, -250, 250, 100); -const rightJoystick = new Joystick(ctx, 250, 250, 100); +const leftJoystick = new Joystick(ctx, -250, 250, 100, supportsTouch); +const rightJoystick = new Joystick(ctx, 250, 250, 100, supportsTouch); function drawGrid(ctx, sideLength, gridSquareSize, xOffset, yOffset) { ctx.save();