With the continuous frustrations of having to deal with mapping key movements to Actionscript 2.0, I decided to see if a switch to Actionscript 3.0 would be more beneficial.
Arrow Keys and W,S,A,D to move the characters.
Numpad 0 to raise player's arms, was supposed to be summoning some kind of energy beam, now it just looks like a hug.
And with that, full character movement was born! What I realised in the difference was that in AS2 the coding revolved around the objects, but when I switched over to AS3, everything made a little bit more sense. I didn't really like the switch from AS2 because I was already used to writing my own functions and events, but AS3 organises the information in a much more logical way.
In AS3, my code was based on event listeners that would understand when a key would be pressed down, and when a key was released, and when animations should be stopped. All of the code was organised under these three different event listeners, and everything seems to happen perfectly without glitching by pressing multiple keys at once. This made it easier to add in more animations and map more actions to different keys. This would make way for collision testing with hitTest functionality, and testing for keylock combinations in modern keyboard to troubleshoot the multiplayer experience.
Thursday, 14 January 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment