{"id":164,"date":"2011-10-16T23:19:10","date_gmt":"2011-10-17T06:19:10","guid":{"rendered":"http:\/\/courses.haigarmen.com\/isma303\/?p=164"},"modified":"2011-10-16T23:19:10","modified_gmt":"2011-10-17T06:19:10","slug":"growing-circle","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/isma303\/growing-circle\/","title":{"rendered":"Growing Circle"},"content":{"rendered":"<p>Open a new script and enter the code in the following code. Don&#8217;t worry about if you don&#8217;t understand all the instructions in the function blocks \u2013 a few more new concepts are being introduced here we&#8217;ll step through:<\/p>\n<pre>int diam = 10;\nfloat centX, centY;\n\nvoid setup() {\n   size(500, 300);\n   frameRate(24);\n   smooth();\n\n   background(180);\n   centX = width\/2;\n   centY = height\/2;\n\n   stroke(0);\n   strokeWeight(5);\n   fill(255, 50);\n}\n\nvoid draw() {\n   if (diam &amp;lt;= 400) {\n   background(180); \/\/ redraw the gray background colour for each loop\n   ellipse(centX, centY, diam, diam);\n   diam += 10;\n   }\n}<\/pre>\n<p>Next we&#8217;ll try to add some conditions to make it shrink when it gets to 400 pixels in diameter. See <a href=\"http:\/\/courses.haigarmen.com\/isma303\/growing-shrinking-circle\">Growing &amp; Shrinking Circle<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Open a new script and enter the code in the following code. Don&#8217;t worry about if you don&#8217;t understand all the instructions in the function blocks \u2013 a few more new concepts are being introduced here we&#8217;ll step through: int diam = 10; float centX, centY; void setup() { size(500, 300); frameRate(24); smooth(); background(180); centX [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-164","post","type-post","status-publish","format-standard","hentry","category-exercises"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/posts\/164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/comments?post=164"}],"version-history":[{"count":0,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/posts\/164\/revisions"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/media?parent=164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/categories?post=164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/tags?post=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}