{"id":28,"date":"2011-07-02T12:00:00","date_gmt":"2011-07-02T12:00:00","guid":{"rendered":"https:\/\/eric.tedjamulia.com\/blog\/canvas-dodge\/"},"modified":"2011-07-02T12:00:00","modified_gmt":"2011-07-02T12:00:00","slug":"canvas-dodge","status":"publish","type":"post","link":"https:\/\/eric.tedjamulia.com\/blog\/canvas-dodge\/","title":{"rendered":"Dodge, now on a canvas"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Whenever I am learning a new language or platform, I seem to end up writing Dodge again. Move a square around, avoid the bad blocks, and see how long you can keep going. This time I tried it with the HTML canvas.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is an 800-by-600 canvas with a plain JavaScript loop running about twenty times a second. The mouse moves the player, enemies enter from the edges, and rectangle intersection checks handle collisions. Staying alive makes the square grow; collecting a green block shrinks it and adds points. The previous score and high score stay around in memory while the page is open.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I actually showed a version of this to my interviewer when I applied to the Internet Explorer team. I cannot say whether it was what got me the internship, but it was nice to have something I could actually show rather than just talk about. Not bad for a game made mostly out of rectangles.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/etedj.com\/projects\/dodge.html\">Play Canvas Dodge<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever I am learning a new language or platform, I seem to end up writing Dodge again. Move a square around, avoid the bad blocks, and see how long you can keep going. This time I tried it with the HTML canvas. It is an 800-by-600 canvas with a plain JavaScript loop running about twenty [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":29,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[7,26,3],"class_list":["post-28","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-games","tag-canvas","tag-internet-explorer","tag-javascript"],"_links":{"self":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":0,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/media\/29"}],"wp:attachment":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}