Monday, November 30, 2009

Case 10 - start-, loss- and winscreen.

In the tenth and final case we had to make a startscreen, losscreen and winscreen. This mainly meant making buttons instead of movieclips, that got binded up to some mouseevents that triggered another functions. To make everything work I had to make several different functions. One to load the startscreen when booting up the game. One to remove that screen and load the game itself. Then add new ifs that would check if I died or won the game. Which then would remove some eventlisteners and load either the loss or winscreen and give us the option to restart the game. The restart button in those screens called up the remove everything function and then call the function that starts te game again, and resetting the timer and number of rumbottles collected from last game.

To make the character die I had to make some kind of a lifebar. So I borrowed a book from a classmate which had a exellent  example for a hpbar. Fundation Game Design with Flash were the name of that book. Written by Rex van der Spuy. When the hpbar where done I could make my character die by attacks.

I then did case 09, as described in previous post, and finished my game!

Case 09 - Sound

This is really the last case I did, because I pretty much did the two last cases at the same time and thought that getting case 10 done where more important. But I'll be writing them in correct order anyway.

Before doing either case 9 or 10, I had to make my sidescrolling to work ingame. I did that by simply making the ground move instead of the pirate. Since the ground had to move, everything else had to move along with it. So in the movepirate function I had to add in all object's x-coordinate and what speed they should have. I then made the environment. New ground with beach, grass and a dojo. Background with sea and a ship, then the sky with the sun. I then readjusted the array so that the rumbottles would be correctly placed.

Case 09 where about sound. Adding music and other sound that had to be triggered by events. Because of lack of time I didn't really got to add many sounds. I didn't find any good and fitting music for my game, so instead of music I added a ambient sound. A sound of soft waves hitting the beach. I thought this would fit nicely as the game's setning is by the ocean/beach. I then found a sound of someone running with boots. It where pretty long and its pace variated. So I edited the clip in Soundbooth and cut it down to have two steps. This way the footsteps ingame would have a steady and nice rythm to it. I had some problems getting the run sound to play correctly. In the beginning the run sound would start playing for every frame I held in one of the run buttons. With some help from a classmate I got that fixed by making a new boolean and adding new statements here and there in the main class.

Tuesday, November 24, 2009

Case 08 - Timer and arrays

So, in this case we got the task to make a timer and use arrays for something. The time could either count down or just count how long time you use to complete the game. So far I have chosen a timer that start on 0 and count upwards. I might change it to a countdown, so that you have complete the game within a certain timelimit.
I started out from the example from the labclass, and made it so that it starts counting when starting the game. I didn't make it a new class in its own .as-file because I honestly haven't grasped the class system yet and find it a little confusing. I did the same for the arrays, which I use to insert some bottles of rum, which collect points when picked up. Like I did with the timer, I took the lab example tried to understand how it works. I managed to add the bottles with array, then adding a hitTestObject with the pirate so they can be picked up and add points to the total score. I planed to add gravity to the arrays/bottles so that they would just fall to the ground and stay there. But when I tried that it just messed up the pirates physics aswell. So I ended up by just placing the bottles by inserting fitting x and y coordinates. To display the collected points/score I did the same as in the timer. Made a new dynamic text field, made a new :int variable which increases by 50 when picking up a bottle. A function that make that :int variable into a string, and then inserting that string function into the dynamic textfield.

Sunday, November 01, 2009

Case 07 - New class, enemy

In this case we had make a new class and a object/enemy that would follow and execute a action when colliding with our main character. I didn't really look into it before wednesday, tried to look into some of my books without understanding much. I found a example on fronter, which I think was uploaded by mistake since it was removed later. Allthough, it was a clean example and with that I could figure out how to create a new class and make it work together with my main class file. Also the basic enemy AI in that example worked just as I intended my enemy to behave, with modifications and additional lines of course. I added gravity and velocity, taken from the main class, and made it so that when the enemy is at the same x-coordinate as the character it plays the idle animation. When colliding it plays a attack animation and resets the pirates position.
I had a little problem with my enemy, when it collided with my character it wouldn't stop attacking and start following again. So one of research assistants/tutors gave me a tip about timer events and showed the basics to set it up on the fridays workshop. Though, I forgot some minor details and had to look it up to succesfully add a timer to my enemy AI. I found a forum thread where someone got help to set up a timer, and I found out that my timer code just had some minor faults.

The lab class for this case were informative and helpfull to further understand classes and basic AI to make objects follow other objects.

Forum thread that helped me out with timer: http://www.actionscript.org/forums/showthread.php3?p=926165

Monday, October 26, 2009

Case 06 - Gamedesign and concept

So in this case we had to work out a more spesific details on how our game will be.
As said in earlier posts, my game is about a pirate that get his parrot kidnapped my ninjas. The reason for them doing that is to get the location of the pirate's treasure. In a note they say they'll kill the parrot if the pirate don't give them the location. The pirate decides to refuse their demands and goes to save his parrot. Meanwhile the ninjas try to interrogate the parrot.
That's pretty much my game's story, the intro atleast. I'm not sure if I gonna make a intro sequense for that yet though.
I've been thinking on how the background and surroundings will look like. Pretty sure the background will be the sea with the pirate's ship floating, and a sky with some clouds ofc. The pirate will start off at the beach and from there it will go to higher ground where there is some bushes and trees, maybe cherrytrees with blossoms falling, and then find the ninja's dojo nearby. As you might guess the setting will be in japan. Inside the dojo the pirate will meet ninjas sneaking about, and there will be traps and ninjas hiding in the roof, walls and beneat the floor. The hiding ninjas will pop up and attack you if you get to close. As for traps it might be things like shooting arrows from different directions and/or shurikens(throwing stars/knives).
There's a chance that I will add a duck function to my pirate, which primary will be used for dodging high horisontal attacks and traps.
Things may change as I find out what's doable or not, and how much time I get to make things work.

Although I got the basic ideas ready, I havent drawed any examples or anything. What I have made is a ninja walking/sneaking, ready to be implented as a enemy in next case. Though, it still needs a attack animation and possibly a jump animation.

Monday, October 19, 2009

Case 05 - Collision and gravity

The task in this case was to get our character to follow a ground when walking back and forth, and jump. To make this happen we had to program some basic physics, gravity and velocity, and add in a ground. The ground is simply a shape in a movieclip which we import into the scene.  By using hitTestPoint for the ground variable, a designated object will collide with the ground, which in this case is my character.
When we got the case we got an example code on how this is done in a .docx. I tried to implent this example into my own code, but it didn't work. Without giving me any errors, my character simply walked in the air. I later found out I just missed one single letter that prevented the whole thing to work. Fixing that everything worked as it should. I then adjusted the jumping a bit by increasing the gravity variable and the amount of velocity the character gain when jumping. Giving it a slight different feel from the example code.
I made a new jumping animation in this case, since the first one I had was rather bad. Though the new one just looks like the run animating, but slower. But it still looks better than the old one.
I got some help and tips from fellow classmates on how to make my pirate to constantly use the jump animation in mid-air untill landing on the ground, and not play any other animation when pressing left or right while airborne. This was pretty much done by adding a boolean variable.

In this weeks lab class we only got an example on the parameters we needed to complete the case. How to implent it into our code were up to ourselfs. I were pretty much done with my solution before the lab class, but it were quite informative.


Monday, October 12, 2009

Case 04 - Programming events in AS3.0

In case 04 that task were to program our character to move to the right and left by using the keyboard. To make that happen we had to program Events in AS3.0.
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!

Sunday, September 27, 2009

Case 03 - ActionScript 3.0

In this case we had to use Actionscript 3.0 in Flash to move a object, which could be a simple square or our character, back and forth while not going outside of the scene/screen.

I started reading Learning ActionScript 3.0 - A Beginner's Guide(R. Shupe and Z. Rosser) trying to get a basic understanding of AS3.0, but I found it quite hard to get into it. And it would take me forever to go through that book to find the exact information I needed to complete this case.

So I pretty much ended up waiting for the lab class last Thursday, where we learned the basics of setting up a AS3.0 document and making things move. After that class I feel I got a somewhat understanding how this works, and should be able to solve future cases involving actionscript 3.0.

With some tips from fellow classmates I got my character to turn on the exact spot before going out of the scene and flip the animation when running back.


 
Click it to see it in action

Monday, September 21, 2009

Case 02 - Animation

In this case our task was to animate our character. It had to be animated so it can run to the right, left and start a jump.

After the lab class last thursday(17/9/09) I started working on the animations. The lab class were pretty informative, just enough for the basic. Such as setting up our character for animation, tweens, anchorpoints, bone tool and ect. Their video tutorials they linked to on fronter.com were quite handy.
I also used various tutorials on internet and books to figure out how I should animate. Look at the bottom of this post for list of resources.

I joined some people from my class and people from the 2nd year classes LAN evenings, there we worked on our animations, helped each other solving various problems we had with flash and shared some tips.
Arranging evening such as this really helps, and its also alot more fun than figuring out everything on your own.

I ended up using the bone tool and motion tween, and this is the results.
To make a run cycle and ect. that goes left I just flipped the animations, so I didn't bother posting them here since they look pretty much the same.

Animating in flash ain't easy, but not hard either. I had some issues with flash while animating, wierd behaviour and "random stuff" happening almost all the time. Especially the bone tool like to mess things up. Their anchorpoints tend to move around, resulting in missplaced symbols/"limbs".
Allthough, I think the results ended up ok, nothing superfancy but they will do their job. There will probably be some more animations and tuning before the finished game.

Resources:
Fronter tutorial - Fra animasjon på scenen til symbol
Fronter tutorial - Hvordan sette sammen en "Sprite"
Fronter tutorial - Horisontal flipping av animasjon i en sprite
heyflash.com - Flash CS4 Tutorial - Animation (walk cycle and bone tool)
How to cheat in Adobe Flash CS4, Chris Georgenes - Chapter 4: Motion tips and tricks

Monday, September 14, 2009

Case 01 - Character and basic gameconcept

In case 01 we had to design and draw a character in Flash, ready to be animated. Also we kinda had to have a gameconcept.

I started with sketching various characters in Photoshop. Since I had no idea for what gamedesign I was going for I just drawed some few different characters, tho I kept the same style overall.
After some minor brainstorming I decided to go with the pirate(#5 in sketch). The gameconcept is at this very moment pretty simple, you play as the pirate that gotta save his dear parrot from the sneaky ninjas. Expect a more fleshed out gameconcept on a later date.
Then I continued in Flash, bringing over the pirate sketch and started drawing. I primarly used the Pen tool, Line tool and Fill tool/Bucket tool. And also Brush tool for certain details.
 
And that's how it turned out after some struggling with Flash. There'll probably be some retouching and redrawing before the final game, but this will do untill then.
And that's pretty much it for case 01, I think. Anyhow, I'm going to bed..

Introduction - Better late than never

Through this blog I will write about how I progress and solve various "cases", which in the end will be a Flash-based platformer game.
This is a school project in Animation & Interactivity class, and the finished game gotta be completed this semester. We're doing this by solving a number of cases, where in each one we gotta solve certain tasks. Such in case 01 we have to learn to use the drawing tools in Flash CS4 and make a character, which must be ready for case 02's task, animation.

That should be enough for the introduction. :-P

Thursday, September 10, 2009

And so it begins

Not much yet. Stay tuned for updates in the coming days. ; )