html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/p5.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
background-color: 0;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
let rndX=0;
let rndY=0;
let d=20;
let targets=[];
let t;
let frame=0;
let count=0;
let missed=0;
let fRate=1.5;
let lifes=5;
let rate=0.04;
class Target{
constructor(x,y){
this.w=d;
this.h=d;
this.v=1;
this.x=x;
this.y=y;
this.r=0;
this.g=255;
}
grow(){
this.w+=this.v;
this.h+=this.v;
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run