{"id":950,"date":"2010-12-24T04:51:08","date_gmt":"2010-12-24T08:51:08","guid":{"rendered":"http:\/\/patorjk.com\/blog\/?p=950"},"modified":"2014-01-25T17:50:15","modified_gmt":"2014-01-25T21:50:15","slug":"snake-game-update","status":"publish","type":"post","link":"https:\/\/patorjk.com\/blog\/2010\/12\/24\/snake-game-update\/","title":{"rendered":"Snake Game Update"},"content":{"rendered":"<p>You can play snake in the box below.<\/p>\n<div id=\"game-area\" tabindex=\"0\"><\/div>\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"\/games\/snake\/style.css?2010.12.22\" \/>\n<style>\n#game-area {\nline-height:18px;\n}\n    <\/style>\n<p>    <script type=\"text\/javascript\" src=\"\/games\/snake\/snake.js\"><\/script><br \/>\n    <script type=\"text\/javascript\">console.log(\"123\");\n    if ( document.getElementById(\"game-area\") ) {\n    var mySnakeBoard = new SNAKE.Board(  {\n                                            boardContainer: \"game-area\",\n                                            fullScreen: false,\n                                            width: 580,height:400\n                                        });\n    }\n    <\/script><\/p>\n<p>I decided to redo the internals of my <a href=\"http:\/\/patorjk.com\/games\/snake\/\">JavaScript Snake Game<\/a> since it was old and in dire need of an update. I thought about using the canvas element, but since it still has its issues with IE and excanvas can be a little slow, I decided to stick with using divs for the drawing blocks. The game is probably not the best it could be, but it&#8217;s definitely better than where it was at. If you&#8217;re interested in the inner workings I have the source available <a href=\"http:\/\/patorjk.com\/games\/snake\/snake.zip\">here<\/a>. <\/p>\n<p><figure style=\"width: 350px\" class=\"wp-caption alignleft\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/patorjk.com\/images\/blog-2010\/docs.png\" width=\"350\" height=\"199\" \/><figcaption class=\"wp-caption-text\">Documentation Page Example<\/figcaption><\/figure>For this update I also decided to experiment a little with <a href=\"http:\/\/developer.yahoo.com\/yui\/yuidoc\/\">YUI Doc<\/a>, which is a tool that generates documentation for source code. It caught my eye since it creates beautiful looking documentation and it&#8217;s language agnostic, so it could possibly be used for all sorts of projects. The <a href=\"http:\/\/patorjk.com\/games\/snake\/docs\/\">documentation for this Snake game<\/a> probably isn&#8217;t too useful, but on larger projects I could definitely see this kind of thing coming in handy.<\/p>\n<p>The only negative to the tool was that it didn&#8217;t seem well documented itself. I found myself somewhat frustrated in debugging some of the issues I had using it, and I ended up having to do a little hand editing of the output files to remove YUI Library labels. Other than that though, it was a pretty cool tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can play snake in the box below. I decided to redo the internals of my JavaScript Snake Game since it was old and in dire need of an update. I thought about using the canvas element, but since it still has its issues with IE and excanvas can be a little slow, I decided &hellip; <a href=\"https:\/\/patorjk.com\/blog\/2010\/12\/24\/snake-game-update\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Snake Game Update<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-950","post","type-post","status-publish","format-standard","hentry","category-web-apps"],"_links":{"self":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/comments?post=950"}],"version-history":[{"count":12,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/950\/revisions"}],"predecessor-version":[{"id":2732,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/950\/revisions\/2732"}],"wp:attachment":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/media?parent=950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/categories?post=950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/tags?post=950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}