Monday, September 28, 2009

Case 04

Hello.

Today we got our fourth case. So what I'm going to try to do the next week is to write a code that lets me control my character by pressing buttons on my keyboard.
I really don't have much to say at this point since I'm still just reading and watching some tutorials. But I'll be sure to post something interresting the next few days.

Stay tuned! =)

Saturday, September 26, 2009

Case 03 - Final

This is the last post about the third case. As mentioned earlier the scope was to use ActionScript to program the sprite, making it move back and forth in the picture "bouncing" off the edges.

It wasn't really before thursday that I figured out how to do it, all my other trys the days before failed as said. But when we were going through the case with the teacher and a lab assistant they got the same problem I had struggled with the last three days. This was a good thing, at least for me, 'cause then the teacher and assistant had to figure out what was wrong, and by doing that, they showed how to sovle the problem I'd been having.

So when I finally had succeeded in writing a code that made a box bounce off the walls, I changed the code so that my character would replace the box. This was pretty nice because for the first time that week I felt that I managed to get something right.  ^___^
Steffen aslo showed my how to flip the character so it wouldn't run backwards. That's pretty easy, you basically just add the if command and tell the character to .scaleX = -1 one way, and .scaleX = +1 the other way.

Anyway, now I'll tell you more specifically what I did to make this work and complete the third case.
  • First of all I created a new folder and called it "Case 03". This folder was my container for the animation (.fla file) and the script file (.as file).
  • Then I copied my flash file with the animations and my sprite into the folder.
  • Next thing to was was to open Flash and create an ActionScript File. That was the file in wich I wrote the code. Then I savd it as "Document.as" in the Case 03 folder. For this to work the .as file and the .fla file must be in the same folder, otherwise the script can't access the objects in the flash library and make the magic happen.
  • Next up was to ensure that the script file could associate with the .fla file, to do this I went to the properties of my flash document and named the Class of the file to Document - but without the .as at the end. As far as I've understood this has to be done if not the files won't communicate correctly and you'll encounter problems when the script is trying to use ojects from the library.
  • The last thing that had to be done before starting to write the code was to make sure the oject you plan on using can be accessed by the actionscript. To do this I went to the properties page of my walk animation (wich I had decided to use for the experiment) and made sure that:
  • The type of the objetct was Movie Clip.
  • It was ready to get exported for ActionScript.
  • Aslo export in frame 1.
  • Check that the the Class was Walk (the name of the animation).
  • Check that the base class is flash.display.MovieClip.
  • And finally choose the source almost on the bottom of the properties page. To do this I pressed "Browse", and found the .fla file I was working with. When I chose it a new window popped up with the objects in the library, I simply then marked Walk and clicked "Ok".
    • Now all the preparations was done and I could start to write the code.
    • What I did was to follow what the teacher told during the lab while the assistant showed what he wrote on a projector. I tried to write stuff by myself also, to see if I could remember anything from the books I read. Wasn't much though. It's still pretty overwhelming stuff for me :)
    • After writing the code, I added a shadow and made it follow the character while it moved from side to side. But took it away, and made the character turn around each time it reached a border instead, thanks to Steffen ;)
    You're probably getting bored of reading my post now, so I'll add a preview of the flash file with the character running back and forth.



    Case 03 by ~Elr0hiR on deviantART

    Friday, September 25, 2009

    Case 03

    Sorry I'm a little late on this case.
    Here's the first thoughts about my third case :)
    And it's all about ActionScript 3.0. My third case is to move a character on the screen without leaving it, only using AS3.

    My first thoughts about this were that it was going to get interresting. I didn't have any experience with programming, so I had absolutely no clue how it works. I mean, at the time I didn't even know what a code looked like..

    So on monday we got the case, and being eager to take on the new case I spent a couple of hours after school trying to figure out things. I read through the first chapter of Oriley's Learning ActionScript 3.0 A beginners Guide without understand much. It went over the basics, so at least I understood what some of the functions of the code does. Gotta read it again though. Anyway, after reading a bit I looked at the exaple files provided by the teacher and lab assistants and tried to figure out what went on. I tried to implement the example code to my own character, but it failed. After a couple of trys I figured I needed a break so I let it rest for the day.


    The following days I still failed miserably at programming the character to move forth and back on the screen.

    Here's what I was able to do the first couple of days:


    HALP by ~Elr0hiR on deviantART

    Tuesday, September 22, 2009

    Case 02 - Final

    Hey, sorry I'm a bit late on this update :)

    This is the last post about the second case. As you probably know the objective was to animate the character from the first case and make a complete sprite with a running, idle and jumping animation/cycle.

    I spent a lot of last week's evenings and nights with friends from class to complete the case. Even though it seemed quite simple and straightforward at the start, it was far from the truth.
    Making a sprite takes some planning, and you have to know what to do to plan out and do things in the right order.

    This is how I went about doing it:
    • I started out with my character in flash with all the parts on seperate layers.
    • Then by using the Bone Tool I started connecting them by building a skeleton on top of the character. This took some time because when I applied bones the Armature layer was place above the other layers.
    • After I had turned all the parts into movie clips and connected them with the Bone Tool I selected everything and made it into one movie clip. Now the character was done and ready to be animated.
    • Since I now had the character as an movie clip containing the parts and bones, I cleared the scene of everthing and deleted the layers with used to contain the bodyparts.
    • Now with a clean slate I started with the running animation, and after a couple of hours I had it done.
    • Now I created a new movie clip in the library and called it "Sprite", this was the contatainer for the animations. Then I opened the movie clip and dragged my running animation into the Sprite movie clip on the first keyframe.
    • To complete the sprite I did the same as above with the animations; I made a new keyframe inside my sprite and copyed the next animation into it. All in all my sprite contains four keyframs with four animations, one for running left, one for running right, one for jumping and a last one for the idle.
    And that's how it's done kids :)
    I'm pretty satisfied with the character but I've decided to change pretty much everything. New character new game idea etc.
    The reason for this is that I made a pretty complicated character now, and I've learned how to make a sprite and animate. So I want to make something more simplified and stylish, concentrate more on the game as a whole.
    So what am I going to make you may ask. Well, if you continue to follow my blog you'll find out ;)

    And that's all for this case! Oh, by the way, a litte preview of the jump animation(it's cycled so it may look a little wierd).


    Jumping cycle by ~Elr0hiR on deviantART

    Sunday, September 20, 2009

    Case 02 - pt. 2

    It's sunday now, and I'm pretty beat. I've spent almost every day(and night!) animating my character with some friends from the class, and some guys from the 2nd year.
    Don't know what to say actually, except that the guys who've been working with me and the ones from the 2nd class has been very helpful. I managed to make the four animations and put them together into a sprite.

    My conclusion in all of this is that I'm not really the animator type. I mean, it can be fun, but tweaking quirks and perfecting the movements of the character isn't exactly something I enjoy to be honest.

    Anyway now, the animations are done and I can relax for half a day, and then the programming starts. This is going to get interresting :)

    Monday, September 14, 2009

    Case 02 - pt. 1

    Being pretty exited about all that animation stuff, I'm still sitting at school and messing around with my character. After a lot of failures with the bone tool (as you might have read in previews posts) I finally figured it out and was able to apply the bones, thanks to some tips from Steffen and Joachim :)

    And I must say, animating is a lot of work. Getting the rough animation takes no time, but the tweaking to make it look fluid and nice takes a lot of work. I've already started with a running animation of my character, but even though I think I've nailed the basic movement, there's still a lot to do before I can say it's finished.


    First Flash Animation by ~Elr0hiR on deviantART

    Case 02

    New week - new case :)

    In this case I have to animate the character I've made. There are four animations I have to complete; moving to the sides i.e. walking/running left and right, idle standing position and a jump.

    Thursday, September 10, 2009

    Case 01 - pt. 2

    So, as I said, I'm supposed to design a character for a flash game. I really don't have any idea yet of how the animation process works, and because of that I feel a litte unsecure about how to draw the character.
    The only thing I know is that each movable part is supposed to go a layer of it's own, but apart from that I don't really know if there is anything I should do - or try to avoid.

    Well, now I've started to make the base of the character with some simple shading. What I've done is that I've imported the concept art of the character to flash and by using the pen tool traced the drawing, with each bodypart on a different layer. The head on one, the torso on another and so forth.
    The only annoying thing is that flash seem to work in it's own pace, sometimes it cooperates and other times it doesn't... wich can be frustrating, probably it's only my own fault. With some practice hopefully I'll master more stuff :)

    Here's a litte sneakpeek of what I'm working with so far:



    The one to the left is the concept drawn in PhotoShop, and the other one is drawn in Flash.

    Wednesday, September 9, 2009

    Case 01 - pt. 1

    So, now I've tried a couple of things. A bit of drawing, animating a ball using the different tweening methods. All I can say is that I gotta lay down som work hours on this since I'm not used to the interface and don't really have an effective workflow.. But I guess that's something that will develop as long as I keep working with Flash.
    Gotta admit though, drawing in flash isn't quite the same as say.. drawing in PhotoShop. At first I was kinda linke "Ewww". But, I'm getting a little more used to it by now :)

    Monday, September 7, 2009

    Case 01

    The first case revolves around creating the hero/main character for a platform game in flash. Also the character should be designed in a way that doesn't make the animating process too hard.