Showing posts with label flash. Show all posts
Showing posts with label flash. Show all posts

Friday, October 9, 2009

Case 04 - Final

Hello.

This is the final report about the fourth case. I haven't had so many posts for the third and this case, this is because I don't really feel the need of writing about stuffe every other day. As it is getting more difficult, and me not being a born programmer I don't have breakthroughs every day. So I feel it's better is I make an inital post for every case and the sum up how it all went at the end of the week when I've (hopefully) managed to get to the geal :)

So about this case. I'm still having a hard time understanding all the stuff we're going through. Apparently I'm not the born programmer ^^
Anyway, with help from classmates I've managed to get things done. I may not yet fully understand everything, but it feels like I'm slowly learning stuff. I now know that I gotta have a package, I gotta have variables, functions that define the variables, and umm... yeah :)
I'm going to try to explain to you what I've done so far and give you a view of my product so you can test it out for yourself, beacause, yes I was able to make my FlashBob controlable with the arrowkeys :p

First of all I copied my previous case files into an new folder wich I called Case 04. Next up I got rid of fragments of the code that made FlashBob move by himself. Then I had to make new variables. This is what I did:
  • I left the variable for my character be. Then I made variable Booleans (wich basically checks if something is true or not later on). Then I made a variable to define the speed of FlashBob's movement. Set it to 15, wich again means he'll move by 15 pixels, unless I define something else in the function later on.
  • Next up i had to add Event Listeners, these "listen" if any buttons are pressed. And I set it the to check if a KeyIsDown and if a KeyIsUp.
  • Then I added a function that basically stops FlashBob from running out of the stage. This is done by adding conditionals wich ask a question. And the answer decieds what to be done. In this case I told AS that if the position of FlashBob is greater og smaller than the stage width it has to block him.
  • I made a function that decides how FlashBob moves. This is done again by adding coditionals. Since I'll have FlashBob run both to the right and the left I have to add to coditionals, one for each direction. So I got one called leftKeyIsDown and righKeyIsDown.
    • Then I define on what axis I want FlashBob to move, on this case the X axis and then the speed. Since I already have made a variable for that I just refer to it by writing += speed and -=speed. This states that if the left key is down FlashBob will move to the left since it's -= speed, and move to the right if the right key is down because the speed is set to += speed.
    • In the same contitional I also define what frame in my sprite I want to play, my running animation is on the second frame so I tell AS to gotoAndPlay(2).
    • Now, I don't want him to run forward and backward, I want him to always face the direction he's running. This is done by adding another line under the gotoAndPlay. Here I tell AS that then he is running to the left I want to flip FlashBob on the X axis, I do that by writing scaleX = -1. When running to the right i write scaleX = 1. The reason I don't have a + sign is that the original animation of FlashBob is running to the right, so there's no need to flip him over or change his scale.
  • Now I need a function that checks if the keys are pressed. To do this I first make a function that checks if the keys are pressed. And another one to check if the keys arent pressed. I then add the keys I want to use by adding the Key Code of each button. Key Code Overview 
And that's about it. I had a great deal of help on this one... again. I was already having some problems on the previous case, and this was by no means easier. But I've learned a great deal already.
Finally you can check out the product of my hard work here.


Case 04 by ~Elr0hiR on deviantART

On a side note I figured out to add music. You won't hear it it in the preview though. I'm saving this one for the finished game :)

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 :)