{"id":23,"date":"2009-07-10T21:26:36","date_gmt":"2009-07-11T04:26:36","guid":{"rendered":"http:\/\/blog.pavley.com\/?p=23"},"modified":"2009-07-10T21:33:50","modified_gmt":"2009-07-11T04:33:50","slug":"always-start-with-the-face","status":"publish","type":"post","link":"http:\/\/blog.pavley.com\/?p=23","title":{"rendered":"Always Start with the Face"},"content":{"rendered":"<p style=\"text-align: center;\"><a href=\"http:\/\/blog.pavley.com\/wp-content\/uploads\/blog.pavley.com\/2009\/07\/questrian-ui-design.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24 aligncenter\" title=\"Questrian UI Design\" src=\"http:\/\/blog.pavley.com\/wp-content\/uploads\/blog.pavley.com\/2009\/07\/questrian-ui-design.gif\" alt=\"Very rough layout--subject to change!\" width=\"480\" height=\"320\" srcset=\"http:\/\/blog.pavley.com\/wp-content\/uploads\/\/blog.pavley.com\/2009\/07\/questrian-ui-design.gif 480w, http:\/\/blog.pavley.com\/wp-content\/uploads\/\/blog.pavley.com\/2009\/07\/questrian-ui-design-300x200.gif 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>The hardest part of creating a Flash game, after figuring out the idea behind it, is to figure out what it will look like. Once you have those two tasks out of the way the actual coding is easy: <em>The design tells you what to code<\/em>.<\/p>\n<p><em>But first -&gt; <\/em><em><strong>Inspiration! <\/strong><\/em><\/p>\n<p>Since this game will feature multi-player interaction I\u2019m going to borrow from the greatest of all multi-player games: <a href=\"http:\/\/worldofwarcraft.com\">World of Warcraft<\/a>. In WoW you get to battle monsters and other players rendered in an epic 3D virtual world. Sweet! In my little game you\u2019ll do the same, only with dots instead of the epic 3D. A lot of WoW-play boils down to a\u00a0 race between <a href=\"http:\/\/www.wowwiki.com\/Damage_per_second\">DSP<\/a> (damage per second) and <a href=\"http:\/\/www.wowwiki.com\/Healing_comparison\">HSP<\/a> (healing per second). So that\u2019s what my game will do: Let players discover who can keep their little team of dots alive while killing the other guy\u2019s dots.<\/p>\n<p>Like the game the UI will be inspired by Blizzard\u2019s <a href=\"http:\/\/forums.megagames.com\/forums\/showthread.php?p=337884\">magnum opus <\/a>as well. On the left will be unit frames that display the health, mana, and experience of your team. On the right will be unit frames that display your opponent\u2019s stats. In the center will be an animated dot-view of the action. Across the bottom will be command frames: Click these guys and you can target and attack bad dots or help your good dots. Lose and you hang your head in humiliation. Win and you gain experience to progress to the next level. Maybe even some <a href=\"http:\/\/www.google.com\/search?hl=en&amp;client=safari&amp;rls=en-us&amp;defl=en&amp;q=define:loot&amp;ei=cQxYSqHpHOCntgeeqaTdCg&amp;sa=X&amp;oi=glossary_definition&amp;ct=title\">loot<\/a> will drop!<\/p>\n<p>At this point I have a rough idea and a very rough UI design. I like to work it that way. I\u2019ve found it\u2019s a big waste of time to spend hours designing something what will just end up trashed as the concept evolves. <em>It\u2019s time to code\u2026<\/em><\/p>\n<p>I\u2019ll need four major classes: An application class to manage everything, A view class to display stuff to the player, a state machine class to track what is happening to who, and a game engine class to control all the action. (This architecture is called <a href=\"http:\/\/ootips.org\/mvc-pattern.html\">Model View Controller<\/a> (MVC) and is at the heart of almost any well written GUI application.)<\/p>\n<p style=\"text-align: center;\"><a style=\"text-decoration: none;\" href=\"http:\/\/blog.pavley.com\/wp-content\/uploads\/blog.pavley.com\/2009\/07\/flash-project.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26\" title=\"Questrian Flash Project Files\" src=\"http:\/\/blog.pavley.com\/wp-content\/uploads\/blog.pavley.com\/2009\/07\/flash-project.gif\" alt=\"Questrian Flash Project Files\" width=\"213\" height=\"427\" srcset=\"http:\/\/blog.pavley.com\/wp-content\/uploads\/\/blog.pavley.com\/2009\/07\/flash-project.gif 213w, http:\/\/blog.pavley.com\/wp-content\/uploads\/\/blog.pavley.com\/2009\/07\/flash-project-149x300.gif 149w\" sizes=\"auto, (max-width: 213px) 100vw, 213px\" \/><\/a><\/p>\n<p>I&#8217;d like to use a\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Hash_table\">hash map<\/a> to store the current state of my objects in the game. I don&#8217;t really need the efficiency of a hash map. But my ideas are very rough right now and things are going to change. Store keyword-value pairs will make managing change easier than hard coding properties into ActionScript classes. The <a href=\"http:\/\/help.adobe.com\/en_US\/ActionScript\/3.0_ProgrammingAS3\/WS5b3ccc516d4fbf351e63e3d118a9b90204-7eea.html\">Adobe documentation<\/a> suggests I use the Object class to create a fake hash map (associative array) or use the flash.utils.Dictionary class. But I won&#8217;t get cool Java-like <a href=\"http:\/\/pirlwww.lpl.arizona.edu\/resources\/guide\/software\/Java_tutorial\/collections\/interfaces\/collection.html\">collection interface<\/a> convenience functions \ud83d\ude41<\/p>\n<p>Luckily I found: <a href=\"http:\/\/lab.polygonal.de\/ds\/\">AS3 Data Structures For Game Developers<\/a> by Michael Baczynski. Thanks Michael! This library includes Hash Maps, Queues, Trees, and Stacks and more. Hard to believe ActionScript 3.0 doesn&#8217;t include them by default.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The hardest part of creating a Flash game, after figuring out the idea behind it, is to figure out what it will look like. Once you have those two tasks out of the way the actual coding is easy: The design tells you what to code. But first -&gt; Inspiration! Since this game will feature [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"http:\/\/blog.pavley.com\/index.php?rest_route=\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.pavley.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.pavley.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.pavley.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.pavley.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23"}],"version-history":[{"count":6,"href":"http:\/\/blog.pavley.com\/index.php?rest_route=\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":31,"href":"http:\/\/blog.pavley.com\/index.php?rest_route=\/wp\/v2\/posts\/23\/revisions\/31"}],"wp:attachment":[{"href":"http:\/\/blog.pavley.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.pavley.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.pavley.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}