みっつのまる

by wesmookewn

2024-06-17 18:18:07

sketch.js

let a = 0;
let x = 0;
let y = 0;
let c = 0;

function setup() {
  createCanvas(600, 600); //ウィンドウサイズの指定
  background(0, 0, 0); //背景色を指定して1回だけ塗る。
}

function draw() {
  background(0, 0, 0, 5); //背景色を指定して1回だけ塗る。
  a = a + (200 - a) / 100.0;
  x = x + (mouseX - x) / 10.0;
  y = y + (mouseY - y) / 50.0;
  c = c + (600 - c) / 50.0;
  noFill();
  stroke(c, c, 255);
  circle(x, y, a);
  circle(x, a, a);
  circle(a, y, a);
  if (a > 195) {
    a = 0;
  }
  if (c > 255) {
    c = 0;
  }
}

function mousePressed() {
  //マウスのボタンが押し下げられた時の処理
}

function mouseReleased() {
  //マウスのボタンが離された時の処理
}

function keyPressed() {
  if (key == "s") {
    saveCanvas();
  }
}

ファイル一覧

  • index.html
  • p5.min.js
  • p5.sound.min.js
  • sketch.js
  • style.css

ファイルを再アップロード


サムネイル画像を変更