GMU:Bots 'n' Plots/Oliver Hannemann: Difference between revisions

From Medien Wiki
Line 18: Line 18:
Code:
Code:


<pre style="">
<pre style="width:200px;">


"""
"""

Revision as of 17:59, 22 April 2015

Wellcome to my participant page! My name is Oliver Hannemann.

Follow me!

My Bots'n'Plots proyects



My first animated Python robot

OlisLittlePyRobot.gif

Code:


"""

My little Robot

"""

def setup():
    size(400, 400)
    frameRate(10)


def draw():
    
    r = random (225)
    background(r, 150 ,r)
    
    pushMatrix()
    translate(0,50)
    
    # 1. Antenne
    pushMatrix()
    translate(200, 100)
    rotate(r/2)
    line(0, 100, 0, 0)
    popMatrix()

    # 2. Antenne
    pushMatrix()
    translate(200, 100)
    rotate(-r/2)
    line(0, 0, 0, 100)
    popMatrix()
    
    # Kopf
    ellipse(200, 100, 100, 100)
    
    # L Bein
    pushMatrix()
    translate(175, 145)
    rotate(TWO_PI / 20)
    line(0, 0, 0, 150)
    popMatrix()
    
    # R Bein
    pushMatrix()
    translate(225, 145)
    rotate(-TWO_PI / 20)
    line(0, 0, 0, 150)
    popMatrix()
    
    # L Schuh
    pushMatrix()
    translate(130, 285)
    scale(-1, 1)
    triangle(0, 0, 0, 30, 80, 40)
    fill(255, 204, 0)
    popMatrix()
    
    # R Schuh
    pushMatrix()
    translate(270, 285)
    triangle(0, 0, 0, 30, 80, 40)
    popMatrix()
    
    popMatrix()



Contributed links

Random

Twitter Bots

Courses I am taking this semester (SS15)