Skip to content

Commit 67e98ba

Browse files
Add files via upload
1 parent 45f682b commit 67e98ba

File tree

5 files changed

+37408
-0
lines changed

5 files changed

+37408
-0
lines changed

background.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
let particles = [];
2+
let r = 0;
3+
let b = 0;
4+
let g = 0;
5+
let x = 0;
6+
var y;
7+
var mouse;
8+
var ca;
9+
10+
11+
function setup() {
12+
frameRate(20);
13+
ca = createCanvas(windowWidth, windowHeight);
14+
ca.position(0, 0);
15+
mouse = createVector(mouseX, mouseY);
16+
for (let i = 0; i < 250; i++) {
17+
particles.push(new particle());
18+
}
19+
20+
}
21+
22+
function draw() {
23+
background(0);
24+
mousepos()
25+
for (let i = 0; i < particles.length; i++) {
26+
particles[i].move();
27+
particles[i].show();
28+
}
29+
30+
}
31+
32+
function mousepos() {
33+
mouse.x = mouseX;
34+
mouse.y = mouseY;
35+
}

index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<html>
2+
3+
<head>
4+
<meta charset="UTF-8">
5+
<script language="javascript" type="text/javascript" src="libraries/p5.js"></script>
6+
<script language="javascript" src="libraries/p5.dom.js"></script>
7+
<script language="javascript" type="text/javascript" src="background.js"></script>
8+
<script language="javascript" type="text/javascript" src="particle.js"></script>
9+
</head>
10+
11+
<body>
12+
</body>
13+
14+
</html>

0 commit comments

Comments
 (0)