I started off with the .as file from case 03, modifying it so it used my character sprite instead of the one movieclip with the run animation. As I moved on I pretty much had to delete most of the code from case 03 and start from scratch. In the new code I had to make new variables and functions for various keystrokes and listeners so that the code/scene could registrate when certain keys is pressed down and released, in this case right and left directional keys.
When the right directional key is pressed down the character will start moving to the right, and the run animation is played aswell. When the key is released the character will stop and go to the idle pose. Same will happen when left key is pressed down, only that it runs to the left with flipped animations and idle pose.
Fellow classmates were very helpfull in this case, showed me how they did things and explained much of how this and that worked throughout the code.
Click it!
No comments:
Post a Comment