mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
test p5.js
This commit is contained in:
parent
9df1a63624
commit
0f6e6e79e1
11
Games/move-cube/index.html
Normal file
11
Games/move-cube/index.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Cube mover</title>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/p5@1.6.0/lib/p5.js"></script>
|
||||||
|
<script src="draw.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
17
Games/move-cube/js/draw.js
Normal file
17
Games/move-cube/js/draw.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
function setup() {
|
||||||
|
createCanvas(40, 40);
|
||||||
|
}
|
||||||
|
|
||||||
|
function draw() {
|
||||||
|
background(220);
|
||||||
|
//For (var BEGIN; END; INTERVAL){
|
||||||
|
//DO SOMETHING }
|
||||||
|
for (var x = 0; x < width; x += width / 40) {
|
||||||
|
for (var y = 0; y < height; y += height / 40) {
|
||||||
|
stroke(0);
|
||||||
|
strokeWeight(1);
|
||||||
|
line(x, 0, x, height);
|
||||||
|
line(0, y, width, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user