No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
<pre style="font-size:smaller" > | <pre style="font-size:smaller" > | ||
def setup(): | |||
size(400,400) | |||
background(0) | |||
frameRate(10) | |||
def draw(): | |||
a = random(2,3) | |||
background(0) | |||
noStroke() | |||
pushMatrix() | |||
translate(frameCount/-4,frameCount/random(-1.5,-1)) | |||
fill(200,230,120) | |||
ellipse(200,200,20,20) | |||
fill(255,0,0) | |||
rect(190,230,20,20,7) | |||
fill(30,78,240) | |||
triangle(190,230,200,210,210,230) | |||
pushMatrix() | |||
fill(0,233,120) | |||
translate(210,230) | |||
rotate(-PI/a) | |||
rect(0,0,5,20) | |||
popMatrix() | |||
pushMatrix() | |||
fill(0,233,120) | |||
translate(190,230) | |||
scale(-1,1) | |||
rotate(-PI/a) | |||
rect(0,0,5,20) | |||
popMatrix() | |||
popMatrix() | |||
fill(255,random(50,250)) | |||
ellipse(20,frameCount,2,2) | |||
ellipse(50,frameCount*2,2,2) | |||
ellipse(60,frameCount*3,2,2) | |||
fill(255,random(50,250)) | |||
ellipse(80,frameCount*1.5,2,2) | |||
ellipse(120,frameCount/2,2,2) | |||
ellipse(150,frameCount/4,2,2) | |||
fill(255,random(50,250)) | |||
ellipse(160,frameCount*2,2,2) | |||
ellipse(180,frameCount*2,2,2) | |||
ellipse(220,frameCount/2,2,2) | |||
fill(255,random(50,250)) | |||
ellipse(250,frameCount/4,2,2) | |||
ellipse(260,frameCount*2,2,2) | |||
ellipse(280,frameCount/2,2,2) | |||
fill(255,random(50,250)) | |||
ellipse(320,frameCount/4,2,2) | |||
ellipse(350,frameCount*3,2,2) | |||
fill(255,random(50,250)) | |||
ellipse(360,frameCount*1.3,2,2) | |||
ellipse(380,frameCount*1.2,2,2) | |||
saveFrame("koala.png") | |||
</pre> | |||
Revision as of 11:38, 29 April 2015
def setup():
size(400,400)
background(0)
frameRate(10)
def draw():
a = random(2,3)
background(0)
noStroke()
pushMatrix()
translate(frameCount/-4,frameCount/random(-1.5,-1))
fill(200,230,120)
ellipse(200,200,20,20)
fill(255,0,0)
rect(190,230,20,20,7)
fill(30,78,240)
triangle(190,230,200,210,210,230)
pushMatrix()
fill(0,233,120)
translate(210,230)
rotate(-PI/a)
rect(0,0,5,20)
popMatrix()
pushMatrix()
fill(0,233,120)
translate(190,230)
scale(-1,1)
rotate(-PI/a)
rect(0,0,5,20)
popMatrix()
popMatrix()
fill(255,random(50,250))
ellipse(20,frameCount,2,2)
ellipse(50,frameCount*2,2,2)
ellipse(60,frameCount*3,2,2)
fill(255,random(50,250))
ellipse(80,frameCount*1.5,2,2)
ellipse(120,frameCount/2,2,2)
ellipse(150,frameCount/4,2,2)
fill(255,random(50,250))
ellipse(160,frameCount*2,2,2)
ellipse(180,frameCount*2,2,2)
ellipse(220,frameCount/2,2,2)
fill(255,random(50,250))
ellipse(250,frameCount/4,2,2)
ellipse(260,frameCount*2,2,2)
ellipse(280,frameCount/2,2,2)
fill(255,random(50,250))
ellipse(320,frameCount/4,2,2)
ellipse(350,frameCount*3,2,2)
fill(255,random(50,250))
ellipse(360,frameCount*1.3,2,2)
ellipse(380,frameCount*1.2,2,2)
saveFrame("koala.png")