lørdag 26. september 2009

Case 3 - Let the scripting begin!


Case 3 - Running with AS3 by ~SveinE89 on deviantART



In this case we were supposed to use ActionScript 3.0 to move our character. Also, the character should never leave the screen.

My main goal of this case was to learn and understand the basic principles of ActionScript. Throughout the week I studied the Learning ActionScript 3.0, chapter 1 and 2, discussing the topics in the group on Monday, and following the walkthrough on Thursday.

I’ve got some experience from AS1 and 2, and some from HTML and CSS, so my first experience with AS3 wasn’t as scary as it could be. So I managed to make the character move across the screen pretty early. The way I did it, was to add a function with an event listener witch “commands” the character to move along the x-axis each frame. The way I made him turn at the end of the screen was to add a function that said that the character should reverse his speed and flip him horizontally when he reached a specific point on the screen.

On top of the post, I added a link to the finished product. I also added a screenshot of the script at the bottom.






Ingen kommentarer:

Legg inn en kommentar