done renaming
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
void setup() {
|
||||
size(800, 600);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(200);
|
||||
ellipse(frameCount%width, 300, 100, 100);
|
||||
}
|
||||
19
Lektion 1/Arithmetische_Operatoren/Muster/Muster.pde
Normal file
19
Lektion 1/Arithmetische_Operatoren/Muster/Muster.pde
Normal file
@@ -0,0 +1,19 @@
|
||||
void setup() {
|
||||
size(800, 600);
|
||||
}
|
||||
int x = 0;
|
||||
float y = 0;
|
||||
|
||||
void draw() {
|
||||
if (x % 3 == 0) {
|
||||
stroke(0);
|
||||
} else if (x % 3 == 1) {
|
||||
stroke(150);
|
||||
} else {
|
||||
stroke(230);
|
||||
}
|
||||
|
||||
line(x, 0, x, y);
|
||||
x+= 1;
|
||||
y+= 0.5;
|
||||
}
|
||||
20
Lektion 1/Arithmetische_Operatoren/Muster_2/Muster_2.pde
Normal file
20
Lektion 1/Arithmetische_Operatoren/Muster_2/Muster_2.pde
Normal file
@@ -0,0 +1,20 @@
|
||||
void setup() {
|
||||
size(800, 600);
|
||||
}
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
void draw() {
|
||||
if (x % 3 == 0) {
|
||||
stroke(0);
|
||||
} else if (x % 3 == 1) {
|
||||
stroke(150);
|
||||
} else {
|
||||
stroke(230);
|
||||
}
|
||||
|
||||
line(x, 0, x, y);
|
||||
x+= 1;
|
||||
y+= 1;
|
||||
}
|
||||
14
Lektion 1/Arithmetische_Operatoren/Muster_3/Muster_3.pde
Normal file
14
Lektion 1/Arithmetische_Operatoren/Muster_3/Muster_3.pde
Normal file
@@ -0,0 +1,14 @@
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
void setup() {
|
||||
size(800, 600);
|
||||
|
||||
y = height;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
line(x, 0, x, y);
|
||||
x+= 1;
|
||||
y-= 1;
|
||||
}
|
||||
13
Lektion 1/Arithmetische_Operatoren/Muster_4/Muster_4.pde
Normal file
13
Lektion 1/Arithmetische_Operatoren/Muster_4/Muster_4.pde
Normal file
@@ -0,0 +1,13 @@
|
||||
void setup() {
|
||||
size(800, 600);
|
||||
}
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
void draw() {
|
||||
stroke(x / (width / 255));
|
||||
line(x, 0, x, y);
|
||||
x+= 1;
|
||||
y+= 1;
|
||||
}
|
||||
8
Lektion 1/Datentypen/Halbe_Pixel/Halbe_Pixel.pde
Normal file
8
Lektion 1/Datentypen/Halbe_Pixel/Halbe_Pixel.pde
Normal file
@@ -0,0 +1,8 @@
|
||||
// Der Kreis wandert alleine nach rechts
|
||||
float x = 0;
|
||||
|
||||
void draw() {
|
||||
background(255);
|
||||
x+=0.5;
|
||||
ellipse(x, 50, 30, 30);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
void draw() {
|
||||
frameRate(10);
|
||||
println("x=" + mouseX + " y=" + mouseX);
|
||||
}
|
||||
11
Lektion 1/Datentypen/Zeichenverkettung/Zeichenverkettung.pde
Normal file
11
Lektion 1/Datentypen/Zeichenverkettung/Zeichenverkettung.pde
Normal file
@@ -0,0 +1,11 @@
|
||||
String message = "la";
|
||||
|
||||
void setup() {
|
||||
size(800, 600);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
frameRate(10);
|
||||
println(message);
|
||||
message += " la";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
void setup() {
|
||||
size(200, 200);
|
||||
background(255);
|
||||
// Viereck in der mitte
|
||||
|
||||
15
Lektion 1/Lokale_Variablen/Mitte/Mitte.pde
Normal file
15
Lektion 1/Lokale_Variablen/Mitte/Mitte.pde
Normal file
@@ -0,0 +1,15 @@
|
||||
void setup()
|
||||
{
|
||||
size(800, 600);
|
||||
}
|
||||
void draw()
|
||||
{
|
||||
// Clear Background to prevent shadows
|
||||
background(40, 40, 40, 256);
|
||||
|
||||
|
||||
line(0, 0, mouseX, mouseY);
|
||||
|
||||
circle(mouseX, mouseY, 10);
|
||||
circle(mouseX * .5, mouseY * .5, 10);
|
||||
}
|
||||
24
Lektion 1/Lokale_Variablen/Zwillinge/Zwillinge.pde
Normal file
24
Lektion 1/Lokale_Variablen/Zwillinge/Zwillinge.pde
Normal file
@@ -0,0 +1,24 @@
|
||||
void setup()
|
||||
{
|
||||
size(800, 600);
|
||||
}
|
||||
void draw()
|
||||
{
|
||||
// Clear Background to prevent shadows
|
||||
background(40, 40, 40, 256);
|
||||
|
||||
//First circle
|
||||
fill(0, 50, 256);
|
||||
circle(mouseX, mouseY, 100);
|
||||
|
||||
// Second circle
|
||||
// project mouse pos between 0 and 1. Take inverse to get the point symmetric postion
|
||||
PVector fitMouse = new PVector((float) mouseX / (float) width, (float) mouseY / (float) height);
|
||||
PVector twinPos = new PVector((1.0f - fitMouse.x) * width, (1.0f - fitMouse.y) * height);
|
||||
|
||||
fill(256, 50, 0);
|
||||
circle(twinPos.x, twinPos.y, 100);
|
||||
|
||||
|
||||
//println(fitMouseX + ", " + inverseMouseX );
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
final int SPEED = 3;
|
||||
final int RADIUS = 10;
|
||||
|
||||
boolean left1 = true;
|
||||
boolean left2 = true;
|
||||
boolean left3 = true;
|
||||
|
||||
float x1 = random(50, width-50);
|
||||
float x2 = random(50, width-50);
|
||||
float x3 = random(50, width-50);
|
||||
|
||||
void setup () {
|
||||
size(200, 200);
|
||||
}
|
||||
|
||||
// move balls
|
||||
void moveballs() {
|
||||
if (x1+RADIUS>width) {
|
||||
left1=true;
|
||||
}
|
||||
if (x1-RADIUS<0) {
|
||||
left1=false;
|
||||
}
|
||||
if (left1) {
|
||||
x1-=SPEED;
|
||||
} else {
|
||||
x1+=SPEED;
|
||||
}
|
||||
if (x2+RADIUS>width) {
|
||||
left2=true;
|
||||
}
|
||||
if (x2-RADIUS<0) {
|
||||
left2=false;
|
||||
}
|
||||
if (left2) {
|
||||
x2-=SPEED;
|
||||
} else {
|
||||
x2+=SPEED;
|
||||
}
|
||||
if (x3+RADIUS>width) {
|
||||
left3=true;
|
||||
}
|
||||
if (x3-RADIUS<0) {
|
||||
left3=false;
|
||||
}
|
||||
if (left3) {
|
||||
x3-=SPEED;
|
||||
} else {
|
||||
x3+=SPEED;
|
||||
}
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(50);
|
||||
fill(200, 50, 50);
|
||||
|
||||
ellipse(x1, width*0.25, RADIUS*2, RADIUS*2);
|
||||
ellipse(x2, width*0.5, RADIUS*2, RADIUS*2);
|
||||
ellipse(x3, width*0.75, RADIUS*2, RADIUS*2);
|
||||
moveballs();
|
||||
}
|
||||
12
Lektion 1/Systemvariablen/Mitte/Mitte.pde
Normal file
12
Lektion 1/Systemvariablen/Mitte/Mitte.pde
Normal file
@@ -0,0 +1,12 @@
|
||||
void setup()
|
||||
{
|
||||
size(111, 77);
|
||||
surface.setResizable(true);
|
||||
}
|
||||
void draw()
|
||||
{
|
||||
// Beim übertragen richtige Fenstergröße (111 x 77) in die main (setup) Methode eintragen und surface.setResizable(true) setzen
|
||||
background(40, 40, 40, 256);
|
||||
circle(width/2, height/2,50);
|
||||
|
||||
}
|
||||
23
Lektion 1/Systemvariablen/Zaehler/Zaehler.pde
Normal file
23
Lektion 1/Systemvariablen/Zaehler/Zaehler.pde
Normal file
@@ -0,0 +1,23 @@
|
||||
void setup()
|
||||
{
|
||||
size(800, 600);
|
||||
frameRate(60);
|
||||
}
|
||||
float second;
|
||||
float offset = 0;
|
||||
|
||||
void draw()
|
||||
{
|
||||
background(40, 40, 40, 256);
|
||||
//fill(0,0,0,1);
|
||||
second = constrain(((float) frameCount / (float) frameRate) - offset, 0 , 1000);
|
||||
|
||||
if(mousePressed == true)
|
||||
{
|
||||
offset = second + offset ;
|
||||
}
|
||||
|
||||
println(offset + " " + mousePressed);
|
||||
textSize(50);
|
||||
text(second, width / 2 -50, height/2);
|
||||
}
|
||||
13
Lektion 1/Systemvariablen/Zeichen_Ticker/Zeichen_Ticker.pde
Normal file
13
Lektion 1/Systemvariablen/Zeichen_Ticker/Zeichen_Ticker.pde
Normal file
@@ -0,0 +1,13 @@
|
||||
void setup()
|
||||
{
|
||||
size(800, 600);
|
||||
}
|
||||
|
||||
void draw()
|
||||
{
|
||||
// Clear Background to prevent shadows
|
||||
background(40, 40, 40, 256);
|
||||
|
||||
textSize(50);
|
||||
text(key, width / 2, height / 2);
|
||||
}
|
||||
19
Lektion 1/Text-Ausgabe/Ecken/Ecken.pde
Normal file
19
Lektion 1/Text-Ausgabe/Ecken/Ecken.pde
Normal file
@@ -0,0 +1,19 @@
|
||||
void setup() {
|
||||
size(500, 500);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
textSize(20);
|
||||
textAlign(LEFT, TOP);
|
||||
fill(0);
|
||||
text("OBEN LINKS", 0, 0);
|
||||
textAlign(RIGHT, TOP);
|
||||
fill(0);
|
||||
text("OBEN RECHTS", width, 0);
|
||||
textAlign(LEFT, BOTTOM);
|
||||
fill(0);
|
||||
text("UNTEN LINKS", 0, width);
|
||||
textAlign(RIGHT, BOTTOM);
|
||||
fill(0);
|
||||
text("UNTEN RECHTS", width, width);
|
||||
}
|
||||
11
Lektion 1/Text-Ausgabe/TextMauszeiger/TextMauszeiger.pde
Normal file
11
Lektion 1/Text-Ausgabe/TextMauszeiger/TextMauszeiger.pde
Normal file
@@ -0,0 +1,11 @@
|
||||
void setup() {
|
||||
size(600, 600);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(200);
|
||||
textSize(20);
|
||||
textAlign(CENTER);
|
||||
fill(0);
|
||||
text("maus", mouseX, mouseY);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
size(300, 300);
|
||||
|
||||
textSize(100);
|
||||
textAlign(CENTER);
|
||||
fill(0, 100);
|
||||
text("Julia", 153, 153);
|
||||
fill(255);
|
||||
text("Julia", 150, 150);
|
||||
@@ -1,16 +1,24 @@
|
||||
background (233,0,57); // roter Hintergrund
|
||||
noStroke (); // Entfernung der Linien um Überlappung beider Figuren zu verbergen
|
||||
fill (1,50,100); //blaue Färbung
|
||||
|
||||
|
||||
fill (255, 10); // sorgt für Sichtbarkeit aller Linien (Transparenz)
|
||||
|
||||
beginShape (); // Vieleck mit Spitze nach oben
|
||||
vertex (30,80); //linker "Fuß"
|
||||
vertex (50,15); //die obere Spitze
|
||||
vertex (70,80); //rechter "Fuß"
|
||||
vertex (45,60); // Verbindungspunkt
|
||||
endShape ();
|
||||
vertex (50,65); // Verbindungspunkt
|
||||
endShape (CLOSE);
|
||||
|
||||
beginShape (); //Vieleck mit Spitze nach schräg rechts
|
||||
vertex (80, 40); // rechter Arm Spitze
|
||||
vertex (30, 80); // linker Fuß
|
||||
vertex (35, 55); // Verbindungspunkt
|
||||
vertex (37, 55); // Verbindungspunkt
|
||||
vertex (20, 40); // linker Arm Spitze
|
||||
endShape ();
|
||||
endShape (CLOSE);
|
||||
|
||||
beginShape (); // Vieleck mit Spitze nach schräg links
|
||||
vertex (70,80); //rechter Fuß
|
||||
vertex (20,40); //linker Arm
|
||||
vertex (80,40); //rechter Arm
|
||||
vertex (63,55); // Verbindungspunkt
|
||||
endShape (CLOSE);
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
|
||||
fill (255, 10); // sorgt für Sichtbarkeit aller Linien (Transparenz)
|
||||
|
||||
beginShape (); // Vieleck mit Spitze nach oben
|
||||
vertex (30,80); //linker "Fuß"
|
||||
vertex (50,15); //die obere Spitze
|
||||
vertex (70,80); //rechter "Fuß"
|
||||
vertex (50,65); // Verbindungspunkt
|
||||
endShape (CLOSE);
|
||||
|
||||
beginShape (); //Vieleck mit Spitze nach schräg rechts
|
||||
vertex (80, 40); // rechter Arm Spitze
|
||||
vertex (30, 80); // linker Fuß
|
||||
vertex (37, 55); // Verbindungspunkt
|
||||
vertex (20, 40); // linker Arm Spitze
|
||||
endShape (CLOSE);
|
||||
|
||||
beginShape (); // Vieleck mit Spitze nach schräg links
|
||||
vertex (70,80); //rechter Fuß
|
||||
vertex (20,40); //linker Arm
|
||||
vertex (80,40); //rechter Arm
|
||||
vertex (63,55); // Verbindungspunkt
|
||||
endShape (CLOSE);
|
||||
Reference in New Issue
Block a user