Friday 5 December 2014




Achieving Movement

Today I set about getting my character to move from left to right, and while I have achieved this, I'm weary of the overall result due to my lose understanding the coding involved. I might have to go back and try to apply a script that I can comprehend, though I'm not yet convinced there is a script that I can fully comprehend. But I digress, whilst the scripting has proven somewhat elusive, the actual animation tools have so far been a lot of fun to mess around with. 


Animator Tab


Picking up from where I left off, I've added a Run state to the to the Animator tab. I haven't applied a sprite sheet of my character running yet, Right now I'm still using my old sprite sheet as a sort of placeholder while I figure out the rest of the tools I'll need to get my controller moving fluently. The most useful thing I learnt was adding parameters that let me mess around with when and how the run cycle would trigger.
   

Experimenting with Parameters



This is the part of the process that i'm skeptic about. I had a look at some tutorials on creating and moving a 2D character controller and eventually a found one where I could make my controller move left to right without having to draw to separate sprite sheets. Essentially this code would flip my sprite when when I moved left, so it would look like I was viewing it from its opposite parallel side (as opposed to him looking like he was moon-walking or something). This is a good code, with it my character can move while giving the illusion of turning to face the left or right, my discrepancy with it however, is that I don't understand how it does this. I get the broad strokes i.e which part of the code lets him move, which part lets him flip, (its the part that's highlighted) but overall I'm still trying to decipher the details of how it's doing what it's doing.            


The Infamous 'Flip' Code


In the end though, I know how to get my character moving from left to right whilst animated. As long as I can get a controller to move and jump from platform to platform, then I can start building the level and experiment with variables like run speed and jumping distance.


Movement Achieved