09.04.2016 Views

www.ebook777.com

Make_Getting_Started_with_Processing_Second_Edition

Make_Getting_Started_with_Processing_Second_Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 9-1. The owl’s coordinates<br />

Example 9-4: Two’s Company<br />

The code presented in Example 9-3 on page 124 is reasonable if<br />

there is only one owl, but when we draw a second, the length of<br />

the code is nearly doubled:<br />

void setup() {<br />

size(480, 120);<br />

}<br />

void draw() {<br />

background(176, 204, 226);<br />

// Left owl<br />

translate(110, 110);<br />

stroke(138, 138, 125);<br />

strokeWeight(70);<br />

line(0, -35, 0, -65); // Body<br />

noStroke();<br />

Functions 125

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!