{"id":89,"date":"2015-06-16T06:07:55","date_gmt":"2015-06-16T02:07:55","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=89"},"modified":"2015-06-16T06:07:55","modified_gmt":"2015-06-16T02:07:55","slug":"exercise-19","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-19\/","title":{"rendered":"Exercise 19"},"content":{"rendered":"<p>Improving our drawing app<\/p>\n<pre><code>\r\nvoid draw() {\r\n  if (mousePressed == true) {\r\n    point(mouseX,mouseY);\r\n  }\r\n}\r\n\r\nvoid keyPressed() {\r\n  if (key == 's') {\r\n    save(\"my_drawing.png\");\r\n  }\r\n  if (key == 'b') {\r\n    background(random(255), random(255), random(255));\r\n    draw_top_line();\r\n  }\r\n  if (key == 'c') {\r\n    stroke(random(255), random(255), random(255));\r\n    draw_top_line();\r\n  }\r\n}\r\nvoid draw_top_line() {\r\n    strokeWeight(7);\r\n    line(0,0, width, 0);\r\n    strokeWeight(2);\r\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Improving our drawing app void draw() { if (mousePressed == true) { point(mouseX,mouseY); } } void keyPressed() { if (key == &#8216;s&#8217;) { save(&#8220;my_drawing.png&#8221;); } if (key == &#8216;b&#8217;) { background(random(255), random(255), random(255)); draw_top_line(); } if (key == &#8216;c&#8217;) { stroke(random(255), random(255), random(255)); draw_top_line(); } } void draw_top_line() { strokeWeight(7); line(0,0, width, 0); strokeWeight(2); }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":1,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/89\/revisions\/90"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}