torsdag 25. november 2010

Case #6

New Case:
Create an enemy using a seperate class. Make it follow the character. Create a collision or reaction when they collide.

difficulties:
Making the enemy follow the character, reason for this being a fairly unorganized actionscript and the absence of one tiny pointy
parentheses,

implementing the jump for the main character. Realizing I must have accidentally written an extra number in the code deciding Velocity

Making the characters smaller. reducing the scaleX and scaleY for the characters didn't cope with the walking sprites because their widths wouldn't change. So what I did was, I simply reduced the size of the characters main symbol in the Fla. document library. I also adjusted the placement of those symbols to make it look more natural. Before this the characters were kind of hovering over the ground.

Making the character die. At first I just made an animation where the main character blew up. I placed this animation in the sprite for the character and implemented it into the actionscript so that when the character touched the enemy (hitbox) it would play the animation of him dying. As usual the reason this wouldn`t work was a simple mistake. I had reffered to the wrong keyframe in the sprite. The animation looked lame, so I changed it to a simple fade to black with a red implosioin thingy.


Other:
Made the enemy and foreground look more pixelated using Photoshop. Drawing the layers in Photoshop with settings that reduced the resolution of the file gave me exactly the look I wanted in my game

What's a game without an awesome soundtrack? I had already composed a melody for the game but the melody on its own would not suffice for a theme song. So I got a little help from a buddy of mine to make the soundtrack a bit more funkyfresh using FL Studio.

Went through the entire actionscript adding more comments and cleaned all that mess up.

Checkit!
http://www.swfcabin.com/open/1290703643

torsdag 11. november 2010

Case #5


For this case we had to add a couple of things to our actionscript.  We had to create a socalled sprite for our character that triggers more than one animation. In addition to this we had to make a hitTest that allows the character to pick up certain objects placed on the scene. We also had to use a similar hitTest making the character stick to the ground while walking.

Seeing as I had already created a sprite function for the character using the idle animation and the walk animation in the previous case, I felt no need adding another one.  I moved on to the hitTest by creating an object, and adding a code to the actionscript allowing the object to dissapear once the character had touched it. At first this didn`t work and as usual Flash refused to tell me why. I later found out that the problem was the (onFrameloop) function for the cloud animation i made in case 4. Apparently adding another code with the same function for my hitTest messed the whole thing up. I fixed this by removing the onFrameLoop Event for my hitTest and placed the code for the hitTest under my first onFrameLoop code. The character was now able to easily pick up the object. I moved on to the sticking-to-the-ground part of the case by first creating a new ground with an uneven surface. After writing the code for this I thought I was done, but ofcourse the character decided to simply fall to the ground an dissapear forever. The wierd thing was that when i applied the function for the background surface it actually worked, and the character would stick to the ground.  My group leader would later point out to me that the reason for this was that the characters position were too low for the ground, and I was like "OMG", and then i fixed it.  


fredag 5. november 2010

Case #4

Let the programming begin! For this week we had to go through the process of writing codes in actionscript. For many, including me, this was also the process of learning how to write codes. Which basically is like learning a new language.


The case consisted of creating a scene for my game, using the characters and graphic from previous cases. In this scene the main character shall be able to move to the right and to the left using the keyboard arrows. In addition to this the character shall not be able to walk outside the "screen".


In the beginning of the case I simply rewrote the example actionscript handed out by our teacher. Seeing as I didn't get much out of this, apart from learning some basic arrangements, I started looking at the tutorials and documents available on fronter. Again, this was a lot to take in all at once and I feel like programming is one of those learning by doing sort of things, so I started trying out different easy codes and functions. After learning a little bit by doing almost everything wrong, I tried adopting some of the codes from an actionscript provided by our  group leader. This started working in a moonwalk-styled fashion with some glitches here and there, but I was making progress. Then suddenly everything stopped working, and I could not figure out what the problem was. After countless hours of troubleshooting and frustration I started the script from scratch. With a little help of my fellow students I started understanding more of the code functions and was able to create a decent actionscript with the cases requirements.