Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Steps from workshop 4

  • Loading branch information...
commit 44b85a7cfda9af5cece598b5f1024d5be4e23c6f 1 parent f44fab8
@rhmoller rhmoller authored
View
24 sketches/fnug/fnug1/fnug1.pde
@@ -0,0 +1,24 @@
+float posX = 200;
+float posY = 200;
+
+float velX = 0;
+float velY = 1;
+
+void setup() {
+ size(400, 400);
+ noStroke();
+ smooth();
+}
+
+void draw() {
+ background(50, 100, 200);
+
+ posX += velX;
+ posY += velY;
+
+ if (posY > height) {
+ posY = 0;
+ }
+
+ ellipse(posX, posY, 10, 10);
+}
View
30 sketches/fnug/fnug2/fnug2.pde
@@ -0,0 +1,30 @@
+float posX = 200;
+float posY = 200;
+
+float velX = 0;
+float velY = 1;
+
+void update() {
+ posX += velX;
+ posY += velY;
+
+ if (posY > height) {
+ posY = 0;
+ }
+}
+
+void paint() {
+ ellipse(posX, posY, 10, 10);
+}
+
+void setup() {
+ size(400, 400);
+ noStroke();
+ smooth();
+}
+
+void draw() {
+ background(50, 100, 200);
+ update();
+ paint();
+}
View
21 sketches/fnug/fnug3/Fnug.pde
@@ -0,0 +1,21 @@
+class Fnug {
+ float posX = 200;
+ float posY = 200;
+
+ float velX = 0;
+ float velY = 1;
+
+ void update() {
+ posX += velX;
+ posY += velY;
+
+ if (posY > height) {
+ posY = 0;
+ }
+ }
+
+ void paint() {
+ ellipse(posX, posY, 10, 10);
+ }
+}
+
View
BIN  sketches/fnug/fnug3/data/snelandskab.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
14 sketches/fnug/fnug3/fnug3.pde
@@ -0,0 +1,14 @@
+Fnug fnug = new Fnug();
+
+void setup() {
+ size(400, 400);
+ noStroke();
+ smooth();
+}
+
+void draw() {
+ background(50, 100, 200);
+ fnug.update();
+ fnug.paint();
+}
+
View
20 sketches/fnug/fnug4/Fnug.pde
@@ -0,0 +1,20 @@
+class Fnug {
+ float posX = 200;
+ float posY = 200;
+
+ float velX = 0;
+ float velY = 1;
+
+ void update() {
+ posX += velX;
+ posY += velY;
+ if (posY > height) {
+ posY = 0;
+ }
+ }
+
+ void paint() {
+ ellipse(posX, posY, 10, 10);
+ }
+}
+
View
27 sketches/fnug/fnug4/fnug4.pde
@@ -0,0 +1,27 @@
+final int ANTAL = 100;
+
+Fnug[] fnug = new Fnug[ANTAL];
+
+void setup() {
+ size(400, 400);
+ noStroke();
+ smooth();
+
+ for (int i = 0; i < ANTAL; i++) {
+ fnug[i] = new Fnug();
+ fnug[i].posX = random(0, width);
+ fnug[i].posY = random(0, height);
+ fnug[i].velY = random(1, 3);
+ fnug[i].velX = random(-1, 1);
+ }
+}
+
+void draw() {
+ background(50, 100, 200);
+
+ for (int i = 0; i < ANTAL; i++) {
+ fnug[i].update();
+ fnug[i].paint();
+ }
+}
+
View
20 sketches/fnug/fnug5/Fnug.pde
@@ -0,0 +1,20 @@
+class Fnug {
+ float posX = 200;
+ float posY = 200;
+
+ float velX = 0;
+ float velY = 1;
+
+ void update() {
+ posX += velX;
+ posY += velY;
+ if (posY > height) {
+ posY = 0;
+ }
+ }
+
+ void paint() {
+ ellipse(posX, posY, 10, 10);
+ }
+}
+
View
BIN  sketches/fnug/fnug5/data/Verdana-Bold-48.vlw
Binary file not shown
View
44 sketches/fnug/fnug5/fnug5.pde
@@ -0,0 +1,44 @@
+final int ANTAL = 100;
+
+Fnug[] fnug = new Fnug[ANTAL];
+PFont font;
+
+void shadowText(String txt, float x, float y) {
+ fill(0);
+ text(txt, x + 2, y + 2);
+ fill(255);
+ text(txt, x - 2, y - 2);
+ fill(255, 0, 0);
+ text(txt, x, y);
+}
+
+void setup() {
+ size(400, 400);
+ noStroke();
+ smooth();
+
+ font = loadFont("Verdana-Bold-48.vlw");
+ textFont(font, 100);
+
+ for (int i = 0; i < ANTAL; i++) {
+ fnug[i] = new Fnug();
+ fnug[i].posX = random(0, width);
+ fnug[i].posY = random(0, height);
+ fnug[i].velY = random(1, 3);
+ fnug[i].velX = random(-1, 1);
+ }
+}
+
+void draw() {
+ background(50, 100, 200);
+
+ fill(255);
+ for (int i = 0; i < ANTAL; i++) {
+ fnug[i].update();
+ fnug[i].paint();
+ }
+
+ shadowText("God", 100, 150);
+ shadowText("Jul", 120, 250);
+}
+
View
20 sketches/fnug/fnug6/Fnug.pde
@@ -0,0 +1,20 @@
+class Fnug {
+ float posX = 200;
+ float posY = 200;
+
+ float velX = 0;
+ float velY = 1;
+
+ void update() {
+ posX += velX;
+ posY += velY;
+ if (posY > height) {
+ posY = 0;
+ }
+ }
+
+ void paint() {
+ ellipse(posX, posY, 10, 10);
+ }
+}
+
View
BIN  sketches/fnug/fnug6/data/Verdana-Bold-48.vlw
Binary file not shown
View
BIN  sketches/fnug/fnug6/data/snelandskab.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
49 sketches/fnug/fnug6/fnug6.pde
@@ -0,0 +1,49 @@
+final int ANTAL = 100;
+
+Fnug[] fnug = new Fnug[ANTAL];
+PFont font;
+PImage baggrund;
+
+void shadowText(String txt, float x, float y) {
+ fill(0);
+ text(txt, x + 2, y + 2);
+ fill(255);
+ text(txt, x - 2, y - 2);
+ fill(255, 0, 0);
+ text(txt, x, y);
+}
+
+void setup() {
+ size(400, 400);
+ noStroke();
+ smooth();
+
+ font = loadFont("Verdana-Bold-48.vlw");
+ textFont(font, 100);
+
+ baggrund = loadImage("snelandskab.jpg");
+
+ for (int i = 0; i < ANTAL; i++) {
+ fnug[i] = new Fnug();
+ fnug[i].posX = random(0, width);
+ fnug[i].posY = random(0, height);
+ fnug[i].velY = random(1, 3);
+ fnug[i].velX = random(-1, 1);
+ }
+}
+
+void draw() {
+ background(50, 100, 200);
+
+ image(baggrund, 0, 0);
+
+ fill(255);
+ for (int i = 0; i < ANTAL; i++) {
+ fnug[i].update();
+ fnug[i].paint();
+ }
+
+ shadowText("God", 100, 150);
+ shadowText("Jul", 120, 250);
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.