69
edits
| No edit summary | No edit summary | ||
| Line 126: | Line 126: | ||
| ---- | ---- | ||
| '''Homework 3''' | '''Homework 3''' | ||
| • Brush | |||
| [[File:Unbenannt_3.PNG]] | |||
| • Quellcode | |||
| <source lang="java"> | |||
| int n = 1; | |||
| PImage[] images = new PImage[n]; | |||
| int dx = 100; | |||
| int dy = 100; | |||
| int slowdown = 2;  | |||
| float zoom = 0.5; | |||
| void setup() { | |||
|   size(700, 700); | |||
|    background(0, 102, 0); | |||
|    for(int i=0; i < n; i++) { | |||
|     images[i] = loadImage("Schaf.png"); | |||
|   } | |||
| } | |||
| void draw() { | |||
|   int pick = (frameCount / slowdown) % n; | |||
|   translate(mouseX , mouseY); | |||
|   scale(zoom / 4); | |||
|   translate(-dx, -dy); | |||
|   image(images[pick], 0, 0);  | |||
|   } | |||
| </source> <br> | |||
edits