Skip to content

Commit e516005

Browse files
sqdortesqdorte
authored andcommitted
selgnairt
1 parent b3ceef0 commit e516005

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

sqdorte/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>plzkillme</title>
77
<style> body {padding: 0; margin: 0;} </style>
88
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.min.js"></script>
9-
<script src="generarstistic.js"></script>
9+
<script src="selgnairt.js"></script>
1010
</head>
1111
<body>
1212
</body>

sqdorte/selgnairt.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function setup() {
2+
createCanvas(windowWidth, windowHeight);
3+
4+
fill(0);
5+
frameRate(30);
6+
j = 0;
7+
8+
s = Math.floor(Math.random()*100+20); // spacing
9+
}
10+
11+
12+
function draw() {
13+
if (j <= height) {
14+
15+
for (var i = 0; i <= width; i += s) {
16+
triangle(
17+
i,j,
18+
i+(Math.random() <= 0.5 ? 1 : -1)*s,
19+
j+(Math.random() <= 0.5 ? 1 : -1)*s,
20+
i+(Math.random() <= 0.5 ? 1 : -1)*s,
21+
j+(Math.random() <= 0.5 ? 1 : -1)*s
22+
)
23+
}
24+
25+
if ( i >= width ) {
26+
j += s;
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)