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!
Monday, November 30, 2009
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.
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.
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
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
Subscribe to:
Comments (Atom)