{"id":107,"date":"2011-10-18T19:40:58","date_gmt":"2011-10-18T19:40:58","guid":{"rendered":"http:\/\/classes.visitsteve.com\/hacking\/?p=107"},"modified":"2011-10-25T18:33:36","modified_gmt":"2011-10-25T18:33:36","slug":"etch-a-sketch-sketch","status":"publish","type":"post","link":"https:\/\/classes.visitsteve.com\/hacking\/etch-a-sketch-sketch\/","title":{"rendered":"Etch A Sketch Sketch"},"content":{"rendered":"<pre>int x = 215;\r\nint y = 45;\r\n\r\nvoid setup() {\r\n  size(480, 480);\r\n  background(150);\r\n  frameRate(100);\r\n}\r\n\r\nvoid draw() {\r\n  if (keyPressed &amp;&amp; (key == CODED)) { \/\/ If it's a coded key\r\n    if (keyCode == LEFT &amp;&amp; x &gt; 0) {            \/\/ If it's the left arrow\r\n      x--;\r\n    }\r\n    if(keyCode == UP &amp;&amp; y &gt; 0){\r\n      y--;\r\n    }\r\n    if(keyCode == DOWN &amp;&amp; y &lt; 480-25){\r\n      y++;\r\n    }\r\n    if (keyCode == RIGHT &amp;&amp; x &lt; 480-25) {      \/\/ If it's the right arrow\r\n      x++;\r\n    }\r\n    else{\r\n      x = x;\r\n      y = y;\r\n    }\r\n\r\n  }\r\n  fill(255,0,0); \/\/ fill color for dot\r\n  rect(x, y, 5, 5);\r\n  fill(0); \/\/ fill color for line\r\n  if(keyPressed &amp;&amp; (key != CODED)){\r\n    background(150);\r\n  }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>int x = 215; int y = 45; void setup() { size(480, 480); background(150); frameRate(100); } void draw() { if (keyPressed &amp;&amp; (key == CODED)) { \/\/ If it&#8217;s a coded key if (keyCode == LEFT &amp;&amp; x &gt; 0) &hellip; <a href=\"https:\/\/classes.visitsteve.com\/hacking\/etch-a-sketch-sketch\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-class-examples"],"_links":{"self":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":0,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"wp:attachment":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}