Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 930 Bytes

p04.md

File metadata and controls

60 lines (44 loc) · 930 Bytes

Variables 1


  • index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <script src="https://cdn.jsdelivr.net/npm/p5@1.5.0/lib/p5.js"></script>
  <script src="sketch.js"></script>
  <title>P5.js 연습</title>
</head>
<body>
  <h1>Variables 1</h1>

</body>
</html>
  • sketch.js
function setup() {
    createCanvas(400, 300);
    background(0);
}

function draw() {
    // background(0);

    // noStroke();
    // fill(255);
    // ellipse(mouseX, 150, 75, 75);

    // noStroke();
    // fill(mouseY);
    // ellipse(200, mouseX, 75, 75);

    // noStroke();
    // fill(255);
    // circle(mouseX, mouseY, 24);

    noStroke();
    fill(255, 50);
    circle(mouseX, mouseY, 24);
}


function mousePressed() {
    background(0);
}