なんか汚い絵ができるyo

by 青木星海

2024-06-10 18:23:37

sketch.js

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

function draw() {
  // background(0, 0, 0); //背景色を指定して1回だけ塗る。
}

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

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

function keyPressed() {
  blendMode(DIFFERENCE); //ブレンド
  if (key == "a") {
    noStroke();
    fill(70, 0, 40);
    circle(x, y, 50);
  }
  if (key == "b") {
    noStroke();
    fill(60, 69, 59);
    rect(x, y, 50);
  }
  if (key == "c") {
    noStroke();
    fill(30, 255, 30);
    rect(x, y, 50);
    circle(x, y, 50);
  }
  if (key == "d") {
    noStroke();
    fill(0, 190, 30);
    circle(x, y, 50);
  }

  x = x + 27;
  if (x > 550) {
    x = 50;
    y = y + 60;
  }
  if (key == "s") {
    saveCanvas();
  }
}

ファイル一覧

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

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


サムネイル画像を変更