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!