{"id":1162,"date":"2016-01-10T14:11:40","date_gmt":"2016-01-10T19:11:40","guid":{"rendered":"http:\/\/www.bootdiskrevolution.com\/?p=1162"},"modified":"2016-01-10T14:24:56","modified_gmt":"2016-01-10T19:24:56","slug":"menus","status":"publish","type":"post","link":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/menus\/","title":{"rendered":"Menus"},"content":{"rendered":"<p>Back to work on Bleed 2 this week! I picked the menu system off my list of things to do.<\/p>\n<p>Menu systems might not be thrilling to code (or to read about!) but it&#8217;s just one of those things you gotta do if you want a finished game. There&#8217;s a surprising amount to consider, depending on the game. What&#8217;s in each menu, and how can everything be structured to lead logically to each other? How do you handle a keyboard, mouse and gamepad all being used to navigate it? If there&#8217;s more than one player, what do you do about multiple inputs? Etc etc etc. They&#8217;re fun little puzzles to solve for me, to be honest.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1170 aligncenter\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/oldMenus.png?resize=600%2C360\" alt=\"\" width=\"600\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/oldMenus.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/oldMenus.png?resize=300%2C180&amp;ssl=1 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Design-wise, I&#8217;d already taken a first stab at a menu system a long time ago. It was functional, but it was bulky and I couldn&#8217;t fit very many items on the screen at once. It was also bloated in terms of storage, with every menu item held in a sprite sheet with two variants for &#8216;selected&#8217; and &#8216;unselected&#8217;.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetOld.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1168\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetOld.png?resize=300%2C240\" alt=\"\" width=\"300\" height=\"240\" srcset=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetOld.png?resize=300%2C240&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetOld.png?w=640&amp;ssl=1 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">First I thinned everything down, and got navigation and highlighting and some simple animations working, too! I also straightened out the menu &#8212; it used to be angled, which I originally imaged was stylish, but it made it harder to tell which item was selected and appears messy to me now.<\/p>\n<p style=\"text-align: left;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1163 aligncenter\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/menuA.gif?resize=480%2C270\" alt=\"\" width=\"480\" height=\"270\" \/><\/p>\n<p style=\"text-align: left;\"><!--more--><\/p>\n<p style=\"text-align: left;\">I redesigned how the menu items are stored and built, too: now it&#8217;s done with a lot less graphics memory. Here&#8217;s the new sprite sheet.<\/p>\n<p style=\"text-align: left;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1167 aligncenter\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetNew.png?resize=320%2C256\" alt=\"\" width=\"320\" height=\"256\" srcset=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetNew.png?w=320&amp;ssl=1 320w, https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/spriteSheetNew.png?resize=300%2C240&amp;ssl=1 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/p>\n<p style=\"text-align: left;\">That&#8217;s it, and it can be reduced a lot further if I want to! Basically, it takes the filled white lines near the top, colours them, combines them, and adds some text for the labels.<\/p>\n<p style=\"text-align: left;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1165 aligncenter\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/menuBreakdown.png?resize=410%2C500\" alt=\"\" width=\"410\" height=\"500\" srcset=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/menuBreakdown.png?w=410&amp;ssl=1 410w, https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/menuBreakdown.png?resize=246%2C300&amp;ssl=1 246w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/p>\n<p style=\"text-align: left;\">The labels on the menu items are read from a text file now, so it&#8217;s very easy to edit them. I also coded a general menu system, so when I want to make a new one I just say &#8220;make me a menu, here are the labels for its items&#8221; and BAM! Much of the work is done for me.<\/p>\n<p style=\"text-align: left;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1164 aligncenter\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/menuB.gif?resize=480%2C270\" alt=\"\" width=\"480\" height=\"270\" \/><\/p>\n<p style=\"text-align: left;\">Obviously the grey background wasn&#8217;t going to stick around either, so I made a simple animation to play behind the menus. It uses the menu sprite sheet, too &#8212; it&#8217;s the pointy white sprite in the top-right. It gets randomly re-sized and re-coloured and shoots out at random speeds and positions over and over, and its end is stretched to leave the trail behind it.<\/p>\n<figure id=\"attachment_1166\" aria-describedby=\"caption-attachment-1166\" style=\"width: 480px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-1166 size-full\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2016\/01\/menuC.gif?resize=480%2C270\" alt=\"\" width=\"480\" height=\"270\" \/><figcaption id=\"caption-attachment-1166\" class=\"wp-caption-text\">Oh jeez, I spelled &#8216;accessibility&#8217; wrong. The world knows my shame!<\/figcaption><\/figure>\n<p style=\"text-align: left;\">It&#8217;s simple, but in my opinion it works and doesn&#8217;t need to be much more! I also added slider bars, on\/off switches, and tool tips to explain menu items that might not be clear.<\/p>\n<p style=\"text-align: left;\">At this point I&#8217;d say I have 75% or more of the menus done and all hooked up! There&#8217;s a few left that are more complicated than most (like the leaderboards or the level select) so I&#8217;ll save them for later, when I have all those functions together and working.<\/p>\n<p style=\"text-align: left;\">See you next week!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back to work on Bleed 2 this week! I picked the menu system off my list of things to do. Menu systems might not be thrilling to code (or to read about!) but it&#8217;s just one of those things you gotta do if you want a finished game. There&#8217;s a surprising amount to consider, depending <a class=\"read-more\" href=\"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/menus\/\">[&hellip;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1162","post","type-post","status-publish","format-standard","hentry","category-bleed-2"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts\/1162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/comments?post=1162"}],"version-history":[{"count":9,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts\/1162\/revisions"}],"predecessor-version":[{"id":1179,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts\/1162\/revisions\/1179"}],"wp:attachment":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/media?parent=1162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/categories?post=1162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/tags?post=1162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}