Justus: Unterschied zwischen den Versionen
Aus exmediawiki
Justus (Diskussion | Beiträge) |
Justus (Diskussion | Beiträge) |
||
| Zeile 1: | Zeile 1: | ||
=120525= | ===120525=== | ||
Exmediawiki Into | |||
<br> | <br> | ||
| Zeile 8: | Zeile 9: | ||
https://bmoren.github.io/p5js-cheat-sheet/ | https://bmoren.github.io/p5js-cheat-sheet/ | ||
==Code01:== | |||
====Code01:==== | |||
function setup() { | function setup() { | ||
| Zeile 36: | Zeile 38: | ||
==Code02:== | ====Code02:==== | ||
function setup() { | function setup() { | ||
Version vom 18. Mai 2025, 16:19 Uhr
120525
Exmediawiki Into
break
https://bmoren.github.io/p5js-cheat-sheet/
Code01:
function setup() {
createCanvas(400, 400); noFill();
}
function draw() {
background(220);
rect(width / 2 - 100 / 2, height / 2 - 100 / 2, 100, 100); rect(width / 2 - 200 / 2, height / 2 - 250 / 2, 200, 250); rect(width / 2 - 150 / 2, height / 2 - 230 / 2, 150, 230); rect(width / 2 - 40 / 2, height / 2 - 40 / 2, 40, 40); rect(width / 2 - 190 / 2, height / 2 - 260 / 2, 190, 260);
}
https://editor.p5js.org/jkfmn/full/-Do64urgx
Code02:
function setup() {
createCanvas(400, 600); //noLoop(); //Loop an/aus noFill();
}
function draw() {
background(220); let rectHeight = random(50, 100); //variable für die des dreiecks vergeben let rectWidth = random(50, 100); let rectX = width/2 - random(50,100)/2; //einfach Wert durch random() ersetzt let rectY = height/2 - random(50,100)/2; rect(rectX,rectY,rectWidth,rectHeight) //how to safe the singular frames???
}
https://editor.p5js.org/jkfmn/full/pf3QVzbWD