From 1f3463225e01a8e0a57b2c98517d4b92144c2b7a Mon Sep 17 00:00:00 2001 From: Eric Ratliff Date: Thu, 26 Jun 2025 09:35:00 -0500 Subject: [PATCH] Fanning gun out in front --- sketch.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sketch.js b/sketch.js index b16aab9..e1eb055 100644 --- a/sketch.js +++ b/sketch.js @@ -88,7 +88,7 @@ function draw() { } // Spawn green orb periodically - if (millis() - lastGreenSpawn > 0 && !greenOrb) { + if (millis() - lastGreenSpawn > 20000 && !greenOrb) { greenOrb = new GreenOrb(); lastGreenSpawn = millis(); } @@ -232,12 +232,12 @@ function keyPressed() { if (ship.quadShotActive) { // Fire in four directions: forward, backward, left, right gun_count = 4 - circle_radians = 2.0 * Math.PI - angle_between = circle_radians / gun_count + shooting_fan_angle = Math.PI / 4.0 + angle_between = shooting_fan_angle / gun_count for (let gun_index = 0; gun_index < gun_count; gun_index++) { gun_angle = gun_index * angle_between - bullets.push(new Bullet(ship.pos, ship.heading + gun_angle)); + bullets.push(new Bullet(ship.pos, ship.heading + gun_angle - (shooting_fan_angle/2.0))); } } else { bullets.push(new Bullet(ship.pos, ship.heading));