{"id":6,"date":"2008-02-28T00:54:00","date_gmt":"2008-02-28T05:54:00","guid":{"rendered":"http:\/\/lukerymarz.com\/alearningexperience\/2008\/02\/updating-the-wizard.html"},"modified":"2008-02-28T00:54:00","modified_gmt":"2008-02-28T05:54:00","slug":"updating-the-wizard","status":"publish","type":"post","link":"http:\/\/lukerymarz.com\/alearningexperience\/2008\/02\/updating-the-wizard.html","title":{"rendered":"Updating the Wizard"},"content":{"rendered":"<p>Well, I felt bad about saying that the wizard tutorial didn&#8217;t end well, so I&#8217;ve modified it a bit to work like I would expect.  You can get the original project <a href=\"http:\/\/www.xnadevelopment.com\/tutorials.shtml\">here<\/a>.  My updated project is available <a href=\"http:\/\/www.lukerymarz.com\/blog\/TheWizard.zip\">here<\/a>.  The main modification is to throw out a lot of the state related code.  The original list of states is:<\/p>\n<p>\/\/The various states the Wizard can be in<br \/>protected enum WizardState<br \/>{<br \/>    Standing,<br \/>    Walking,<br \/>    Magicking,<br \/>    Ducking,<br \/>    Jumping<br \/>}\/\/End enum WizardState<\/p>\n<p>I&#8217;ve replace them with<\/p>\n<p>\/\/The various states the Wizard can be in       <br \/>protected enum WizardState<br \/>{<br \/>    Normal,<br \/>    Ducking,<br \/>    Jumping<br \/>}\/\/End enum WizardState<\/p>\n<p>In the original project, the code only allows for one state at a time, so you end up not being able to walk when jumping, or magick while walking or jumping.  So i took the actions i wanted to be able to do during all times, specifically walking and magicking, and moved those out of the state enum.  They shouldn&#8217;t be treated as states.  They&#8217;re just actions the wizard can take.  Then I realized there needed to be some sort of base state, so I added the Normal state, which is just the default.<\/p>\n<p>The other big change is in the UpdateKeyboard function.  Instead of an if..else if&#8230;else if chain of code, I changed it to a series of if statements so the UpdateKeyboard function will respond to all keys being pressed at once, rather than responding to one and returning.<\/p>\n<p>One final minor change I made was to pull out the crouch animation when the wizard lands.  I didn&#8217;t like it.  I&#8217;ve avoided posting code in here until I know how to get it formatted correctly&#8230; another action item, I suppose.<\/p>\n<p>The end result, if you build my version of the project, is a wizard that can move and magick while jumping.  It feels much more responsive, and makes me feel like I have a lot more control over the wizard.<\/p>\n<p>There.  I feel better now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I felt bad about saying that the wizard tutorial didn&#8217;t end well, so I&#8217;ve modified it a bit to work like I would expect. You can get the original project here. My updated project is available here. The main modification is to throw out a lot of the state related code. The original list [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-xna"],"_links":{"self":[{"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":0,"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"wp:attachment":[{"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/lukerymarz.com\/alearningexperience\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}