{"id":65,"date":"2015-02-13T17:21:17","date_gmt":"2015-02-13T17:21:17","guid":{"rendered":"http:\/\/buildanhtml5game.com\/?page_id=65"},"modified":"2015-02-13T17:26:53","modified_gmt":"2015-02-13T17:26:53","slug":"chapter-3-exercise-1-board-layouts","status":"publish","type":"page","link":"http:\/\/buildanhtml5game.com\/?page_id=65","title":{"rendered":"Chapter 3, Exercise 1 &#8211; Board Layouts"},"content":{"rendered":"<p><em>Each row of the game board is offset to form a staggered pattern. Change the code in createLayout so the bubbles form a regular grid. How will this change the game?<\/em><\/p>\n<p>Change on line in the createLayout function in board.js:<\/p>\n<p><code>var createLayout = function(){<br \/>\n&nbsp;&nbsp;var rows = [];<br \/>\n&nbsp;&nbsp;for(var i=0;i&lt;NUM_ROWS;i++){<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;var row = [];<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;var startCol = 0;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;for(var j=startCol;j&lt;NUM_COLS;j+=2){<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var bubble = BubbleShoot.Bubble.create(i,j);<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;row[j] = bubble;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;};<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;rows.push(row);<br \/>\n&nbsp;&nbsp;};<br \/>\n&nbsp;&nbsp;return rows;<br \/>\n};<\/code><\/p>\n<p>The grid is now regular and very odd looking, and it looks like it&#8217;s going to be much harder to join groups of bubbles together!<\/p>\n<p><a href=\"http:\/\/buildanhtml5game.com\/wp-content\/uploads\/2015\/02\/Ex_3_1.png\"><img decoding=\"async\" src=\"http:\/\/buildanhtml5game.com\/wp-content\/uploads\/2015\/02\/Ex_3_1.png\" alt=\"Bubble Shooter Grid Layout\" width=\"960\" class=\"alignnone size-full wp-image-69\" srcset=\"http:\/\/buildanhtml5game.com\/wp-content\/uploads\/2015\/02\/Ex_3_1.png 1000w, http:\/\/buildanhtml5game.com\/wp-content\/uploads\/2015\/02\/Ex_3_1-300x221.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Each row of the game board is offset to form a staggered pattern. Change the code in createLayout so the bubbles form a regular grid. How will this change the game? Change on line in the createLayout function in board.js: var createLayout = function(){ &nbsp;&nbsp;var rows = []; &nbsp;&nbsp;for(var i=0;i&lt;NUM_ROWS;i++){ &nbsp;&nbsp;&nbsp;&nbsp;var row = []; &nbsp;&nbsp;&nbsp;&nbsp;var [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":22,"menu_order":31,"comment_status":"open","ping_status":"open","template":"practice-answer-page.php","meta":[],"_links":{"self":[{"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/pages\/65"}],"collection":[{"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65"}],"version-history":[{"count":6,"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/pages\/65\/revisions"}],"predecessor-version":[{"id":72,"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/pages\/65\/revisions\/72"}],"up":[{"embeddable":true,"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=\/wp\/v2\/pages\/22"}],"wp:attachment":[{"href":"http:\/\/buildanhtml5game.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}