Skip to content

Instantly share code, notes, and snippets.

@ravicious
Created April 11, 2013 10:50
Show Gist options
  • Select an option

  • Save ravicious/5362447 to your computer and use it in GitHub Desktop.

Select an option

Save ravicious/5362447 to your computer and use it in GitHub Desktop.
// TODO
// machanie ręką
// zmieniające się tło
int m, initialTime;
void setup() {
size(500, 500);
frameRate(25);
smooth();
}
void draw() {
background(176, 226, 206);
drawSun();
drawRobotAndGrass();
}
void drawSun() {
m = millis();
initialTime = millis();
// słońce
//ellipse(475, 375, 65, 65);
fill(255, m % 229, 69);
stroke(255, m % 229, 69);
smooth();
pushMatrix();
translate(width/2, height/2);
rotate(degrees(m % 255));
ellipse(200, 100, 65, 65);
popMatrix();
}
void drawRobotAndGrass() {
pushMatrix();
translate(width/2, 0);
rectMode(CENTER);
ellipseMode(CENTER);
// trawa
fill(184, 199, 168);
stroke(184, 199, 168);
rect(0, 450, 500, 100);
fill(200);
stroke(33);
// szyja
rect(0, 155, 15, 40);
// głowa
rect(0, 110, 60, 60);
// oczy
ellipse(-15, 100, 15, 15);
ellipse(15, 100, 15, 15);
// usta
rect(0, 128, 40, 5);
// nogi
rect(-25, 370, 30, 140);
rect(25, 370, 30, 140);
// korpus
rect(0, 240, 120, 180);
// ręce
rect(-60, 230, 20, 120);
rect(60, 230, 20, 120);
popMatrix();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment