Created
June 25, 2014 09:50
-
-
Save jnslxndr/583da867e114d1e3a281 to your computer and use it in GitHub Desktop.
Zeiger Copy & Paste
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Simple Clock Example for 8bit Seminar (bit 5) | |
| Muthesius Kunsthochschule Sommersemester 2014 | |
| """ | |
| from Zeiger import * | |
| # Java: | |
| # Zeiger sekunden = new Zeiger(); | |
| # Eine _Instanz_ eines Zeigers | |
| sekunden = SekundenZeiger() | |
| def setup(): | |
| size(640,320) | |
| def draw(): | |
| smooth() | |
| background(255) | |
| translate(width/2, height/2) | |
| sekunden.draw() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Zeiger: | |
| # Eigenschaften des Zeigers | |
| length = 120 | |
| rotation = 0 | |
| red = 0 | |
| green = 0 | |
| blue = 0 | |
| def update(): | |
| pass | |
| # Methoden des Zeigers | |
| def draw(self): | |
| self.update() | |
| pushMatrix() | |
| rotate(self.rotation - HALF_PI) | |
| strokeWeight(1) | |
| stroke(self.red,self.green,self.blue, 127) | |
| line(0, 0, self.length, 0) | |
| popMatrix() | |
| class SekundenZeiger(Zeiger): | |
| length = 200 | |
| red = 127 | |
| green = 127 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment