@@ -506,38 +506,56 @@ function drawSkyGradient() { |
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | | -function drawMoon() { |
| 509 | +function drawMoon() |
| 510 | +{ |
| 510 | 511 | push(); |
| 511 | 512 | noStroke(); |
| 512 | | - // Brighter moon |
| 513 | + |
| 514 | + // Brighter, farther-reaching moon glow |
| 513 | 515 | fill(255, 255, 240, moonOpacity); |
| 514 | | - ellipse(width - 100, moonY, 50); |
| 515 | | - // Brighter glow |
| 516 | | - fill(255, 255, 220, moonOpacity * 0.5); |
| 517 | | - ellipse(width - 100, moonY, 70); |
| 518 | | - // Extra outer glow for more brightness |
| 519 | | - fill(255, 255, 200, moonOpacity * 0.2); |
| 520 | | - ellipse(width - 100, moonY, 100); |
| 516 | + ellipse(width - 100, moonY, 52); |
| 517 | + |
| 518 | + // Multi-layer radial glow for reach |
| 519 | + push(); |
| 520 | + blendMode(ADD); |
| 521 | + fill(255, 255, 230, moonOpacity * 0.55); |
| 522 | + ellipse(width - 100, moonY, 90); |
| 523 | + fill(255, 255, 210, moonOpacity * 0.35); |
| 524 | + ellipse(width - 100, moonY, 140); |
| 525 | + fill(220, 230, 255, moonOpacity * 0.22); |
| 526 | + ellipse(width - 100, moonY, 200); |
| 527 | + pop(); |
| 521 | 528 | |
| 522 | 529 | // Moon craters with better contrast |
| 523 | 530 | fill(240, 240, 210, moonOpacity * 0.7); |
| 524 | 531 | ellipse(width - 105, moonY - 5, 8); |
| 525 | 532 | ellipse(width - 95, moonY + 8, 12); |
| 526 | 533 | ellipse(width - 110, moonY + 10, 6); |
| 527 | | - pop(); |
| 528 | 534 | |
| 529 | | - if (gamePhase === 'NIGHT') { |
| 530 | | - randomSeed(42); |
| 531 | | - for (let i = 0; i < 50; i++) { |
| 532 | | - let x = random(width); |
| 533 | | - let y = random(height * 0.6); |
| 534 | | - let brightness = random(100, 255); |
| 535 | | - stroke(255, 255, 255, brightness); |
| 536 | | - strokeWeight(random(1, 2)); |
| 537 | | - point(x, y); |
| 538 | | - } |
| 539 | | - randomSeed(millis()); |
| 535 | + // Subtle "godrays" emanating from the moon |
| 536 | + push(); |
| 537 | + blendMode(ADD); |
| 538 | + let baseA = frameCount * 0.0023; // slow drift |
| 539 | + let rayCount = 8; |
| 540 | + for (let i = 0; i < rayCount; i++) { |
| 541 | + let a = baseA + i * (Math.PI * 2 / rayCount) + (noise(i * 0.2, frameCount * 0.005) - 0.5) * 0.2; |
| 542 | + let len = 140 + noise(i * 1.7, frameCount * 0.003) * 120; // 140-260px |
| 543 | + let w0 = 6 + noise(i * 0.9) * 6; // near width |
| 544 | + let w1 = 18 + noise(i * 0.7) * 16; // far width |
| 545 | + let cx = width - 100; |
| 546 | + let cy = moonY; |
| 547 | + fill(220, 230, 255, (moonOpacity * 0.18)); |
| 548 | + noStroke(); |
| 549 | + beginShape(); |
| 550 | + vertex(cx + Math.cos(a + 0.03) * w0, cy + Math.sin(a + 0.03) * w0); |
| 551 | + vertex(cx + Math.cos(a - 0.03) * w0, cy + Math.sin(a - 0.03) * w0); |
| 552 | + vertex(cx + Math.cos(a) * len + Math.cos(a + 0.12) * w1, cy + Math.sin(a) * len + Math.sin(a + 0.12) * w1); |
| 553 | + vertex(cx + Math.cos(a) * len + Math.cos(a - 0.12) * w1, cy + Math.sin(a) * len + Math.sin(a - 0.12) * w1); |
| 554 | + endShape(CLOSE); |
| 540 | 555 | } |
| 556 | + pop(); |
| 557 | + |
| 558 | + pop(); |
| 541 | 559 | } |
| 542 | 560 | |
| 543 | 561 | function updateResources() { |