Skip to content

Instantly share code, notes, and snippets.

@tgb20
Last active January 28, 2025 17:14
Show Gist options
  • Select an option

  • Save tgb20/91509355eab1dcd21075ea606e47868c to your computer and use it in GitHub Desktop.

Select an option

Save tgb20/91509355eab1dcd21075ea606e47868c to your computer and use it in GitHub Desktop.

Revisions

  1. tgb20 revised this gist Jan 28, 2025. 2 changed files with 21 additions and 1 deletion.
    20 changes: 20 additions & 0 deletions bubbles.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    // Bubbles
    function setup() {
    createCanvas(400, 400);
    }

    function draw() {
    background(255);
    fill('green')
    rect(0, 0, 200, 400);
    fill(0)
    rect(200, 0, 200, 400);

    blendMode(DIFFERENCE);
    fill('green');
    noStroke();
    noCursor()
    circle(mouseX, mouseY, 40)

    blendMode(BLEND);
    }
    2 changes: 1 addition & 1 deletion sketch.js → radar.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // RADAR
    let angle = 0;


    function setup() {
    createCanvas(1024, 1024);
    }
  2. tgb20 created this gist Jan 26, 2025.
    29 changes: 29 additions & 0 deletions sketch.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    let angle = 0;


    function setup() {
    createCanvas(1024, 1024);
    }

    function draw() {
    // Background
    fill(0)
    noStroke()
    circle(512, 512, 512)

    // Green sweep
    fill('green')
    arc(512, 512, 1024, 1024, radians(-90 + angle), radians(angle));

    // Sweeping Arm
    stroke(255)
    strokeWeight(8);

    let xArm = 512 * cos(radians(angle)) + 512;
    let yArm = 512 * sin(radians(angle)) + 512;


    line(xArm, yArm, 512, 512)

    angle += 1;
    }