Skip to content

Instantly share code, notes, and snippets.

@jnslxndr
Created June 25, 2014 09:50
Show Gist options
  • Save jnslxndr/583da867e114d1e3a281 to your computer and use it in GitHub Desktop.
Save jnslxndr/583da867e114d1e3a281 to your computer and use it in GitHub Desktop.
Zeiger Copy & Paste
"""
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()
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