0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

javascriptをサイトで実行する

Last updated at Posted at 2024-10-10

このページの作者が使うサイトは?

p5.js一択です!
p5.jsだと動きが見られるから、
なにかのアニメーションや図形、ゲームを作る時に使えます!

使ってみよう

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

let mouseX_m = 0;
let mouseY_m = 0;
function draw() {
  background(220);
  rect(mouseX_m, mouseY_m, mouseX-mouseX_m, mouseY-mouseY_m);
  mouseX_m = mouseX;
  mouseY_m = mouseY;
}

右の薄灰色の背景があるところでマウスを振ったりしてみてください!

このような動きを作れます。
いろいろいじって遊んでみてください!

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?