Wednesday, 4 May 2011

Game Development Final Weds

Yo!

Today is the final Wednesday before we send off the game on Fri (6th) And today is the final details and final programming and testing. I've already done the Alpha testing sheet, so I just need the Beta and the final test. Right now I'm editing my sounds. From the first try, I wanted to add a battle sound (You know, sword clashes, cries, that short of thing) And I added it in, but it was too over-powering for the Monk chant of my background music, but now I used Audacity Portable to make the Battle Cries softer and quieter, so it sounds as if its far away. After playing the game with the new sounds, I wanted the music and battle to stop during the game over, and so I wanted to change all the plays to stop, so instead of being: backgroundMusic.play(0,1000); it's now: backgroundMusic.stop;. At the moment I'm having technical difficulties with the battle cry, because it's written like: var s = new Battle_Cry; s.play (0,1000); I have tried to stop the music using the code:
backgroundMusic.stop();


var s = Battle_Cry;


s.stop(); under the gameOver, but, it doesn't like stopping when the game over screen plays, but it might be that the music is the game function instead of the new game function. I tried placing them under the new game function, but every time I started a new game, the music overlapped and made the music louder, so I'm mostly going to place the music under the game function, and not bother with stopping the music.


I've just played the game once more, and my timers are not working, as in if I die, the miniboss timers don't stop. For example, if I kill two minibosses and die, the third one is played as the first mini boss and then the end boss comes on. After debugging, the game has pointed out my stage.addChild(explosion); line and now it's crashed and will close down.....oh no just the debugging program.


Just debugging and looking through the errors, it seems it has problems with killing my boss, all the errors link to the explosions, winning screen the kill function or the kill in Enemy List. Here is a screen shot of the Errors:







With Steve's help, I've fixed the game bugs with the boss. I added the Game.winScreen(); before the for(var i in EnemyShip.list)
{


if(EnemyShip.list[i] == this)


{


delete EnemyShip.list[i];


}


} This is the function to kill the boss, I also have this code in the winScreen function, meaning the boss was being killed twice, making the game error. Steve also helped the boss timer-countdown-thing. It was the easiest fix, all I had to add was bossCountdown = 3; under the newGame Function.


Having playing the game for the final time, I decided to try and make the character look like it's running instead of standing still. I asked Steve to look and he used a Boolean for a var. This var is var keyright:Boolean=false; Later on in the code, where the code is to run and move, he added


if (keyright == false)


{


keyright = true;


if(Key.isDown(Keyboard.RIGHT))


{


this.x = this.x + Velocity;


this.gotoAndStop(3);


}


}


else{


keyright = false;


} (For those that have followed the blog, they'll know that 3 was to go to the duck frame and 2 was for the run frame(I changed them over) Steve has asked me to create the same for the left. To create the run cycle to work backwards, I used the same method, but changed all the keyrights to keylefts, and I had to change one more part of the code. When we was first looking at the code, we tested with left and used the code: if(Key.isDown(Keyboard.LEFT))


{ this.x = this.x - velocity;


this.run.gotoAndPlay(3);


}, but since I'm using a different code, I changed it back to this.x = this.x - velocity; this.gotoAndStop(3);. So now my player runs backwards and forwards, but slower.


So, this is it, my game is done, all that is needed to do is test my Beta and the final game!!!!

Wednesday, 27 April 2011

27th April 2011

Yo!
Back from Half Term and good news.......my game is in next week!! Today is really me fixing little bugs, which include, text, when the enemy dies, and the winning screen, such as when the game ends the player can still shoot and get points when there is now enemies, and finally the run, they still have a static run when the player pressing down the left or right. My sound is also a little out, as the enemies cries are out a little.
I've changed the positioning of the sound in the Explosion Code, as it was like:

function Explosion()
{
addEventListener("enterFrame", enterFrame);
}
function enterFrame(e:Event)
{
if(this.currentFrame == this.totalFrames)
{
removeEventListner("enterFrame", enterFrame):
stage.removeChild(this):
var s = new ExplosionSound();
s.play();
} This meant the sound played after it had gone, so I changed it so it is now under the function Expolsion() after the addEventListener("enterFrame", enterFrame);, so now when the Explosion is on the screen, then the sound is played, the way it's meant to be.
I just debug my game (again) and it has the same problem as when I last debug (try and read Easter Half Term - 11/04/2011 blog for information on the errors (or if you are too lazy to read the blog post they are :
Boss/kill, Boss/takeDamage, Game$/winScreen and Bullet/enterFrame)
To stop the player to keep shooting, I decided to add the code ship.visible = false; meaning the ship will disappear after the Winning screen has been shown, but the player can still shoot and get more points. Also the power up timer still runs. I've fixed the score update, all I had to do was change the fonts......really? Wow, so simple and it's took me this long to fix!!!! Yeah, so I had to change the font from comic to Lucida Calligraphy that was it, fixed instently.
I've managed to fix the winning screen bug with the player getting more points after the game, this was a simple adding of code which was if(Game.ship.visible == true) I then added this under the if(Key.isDown(Keyboard.SPACE) && shootLimiter >15) {
Like the image below




The only bug left to fix is the run and that is it!

Monday, 11 April 2011

Easter Half Term - 11/04/2011

Yo! For the next two weeks is Easter Half Term, and after that we have two weeks of College before the final date of the 6th (okay one week of those is the same week as the 6th), so it;s really only four weeks to go. So far my game is nearly complete (yeah!) with only a few bugs, mainly the end game and the running bug, so I've came into college during my holidays to complete some of the bugs. Right now I'm working on my game, trying to get the winning screen to come on, right now, it's not working. I did find one bug, I misspelt a line instead of putting winScreenMenu I put winScreenuMenu; With that fixed I tryied again, deciding to rebug my program and getting this message: TypeError: Error #1009: Cannot access a property of a null object reference. at Boss/Kill() at Game$/gameOver() at Ship/kill() at Ship/takeDamage() at EnemyBullet/enterFrame() as well as other errors such as TypeError: Error # 1009: Cannot access a property or method of a null object reference. at Boss/takeDamage() at Bullet/enterFrame() TypeError: Error #1009: Cannot access a property or method of a null object reference. at Explosion/enterFrame() TypeError: Error #1009: Cannot access a property or method of a null object reference. at PointDisplay/enterFrame() I also found that after debugging, I now have two health packs arrive at the same time, this might have something to do with the code I tried, as I was trying to get another element into my game, it works like the pick up, coming in randomly, but takes damage if the player avoids it, but since it didn't work, I decided to drop it and I must of forgot to change the code back. I fixed the double health pick up, I deleted all the code that refered to my seco0nd 'pick up'. Finally!!! I've got my winning screen to appear after the boss is dead!!! Yeah!!! But......the game still plays in the background and button to restart doesn't quite work, so now the screen does show, I will now tweek it slitly to make it work. I found out mu problem, it's really stupid and easy to fix, but I missed it......I kept putting winScreenMenu instead of the winScreen, dope! I'm now really confused, I was just testing my game, when I died, I restarted the game and the next enemy was the boss........alright, what's going on now, in my first game I did beat all three minbosses before the boss was surpose to come out, but when I restarted the game the boss was the first boss and when I killed him the winning screen came on, but the game still continued to play the game. I am really really confused. At the moment, I will try to compare the winning screen to the game over code and see if the problem is there, if not, then I will look into other areas of the code. I'm now having problems with my new game screen, it comes on, but it doesn't want to play and run the game. I've debugged my game again and this is the problem in the output Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts. Attempting to launch and connect to Player using URL E:\College\Steve Rich\Programming\Fenrir Game\Game.swf [SWF] E:\College\Steve Rich\Programming\Fenrir Game\Game.swf - 2543328 bytes after decompression....what? I have no idea what is going on. For now I might use my back-up file I created just before I tried to change anything and try again. I loaded up my back up, and I now have to create the Winning Screen again, but now I know the problem it should be a quick fix, and now I can fix that as well. I've fixed the winning screen, it now comes on when the boss is killed and restarts the game and disappears, the problem was I forgot to write the code, winScreenMenu.visible = false under the newGame function (whoops) but now that works, but now I have a bigger problem, after the defeat of my boss, the bullets start to miss fire (so to speak) and getting a shorter range. The output has placed this error out now TypeError: Error #1009: Cannot access a property or method of a null object reference. at Boss/takeDamage() at Bullet/enhterFrame() I just debugged (again) and I looked through all the Errors here they are: TE:#1009: Caapomoanor (Should know what it means by now) at Boss/kill() [E:\C\SR\P\FG\Game.as:224] - stage.addChild(explosion); at Game$/winScreen()[E:\C\SR\P\FG\Game.as:224] - EnemyShip.list[i].kill(); at Boss/kill() [E:\C\SR\P\FG\Boss.as:81] - Game.winScreen(); atBosstakeDamage() [E:\C\SR\P\FG\Boss.as:44] - kill(); atBullet/enterFrame() [E:\C\SR\P\FG\Bullet.as36] - EnemyShip.list[i].takeDamage(1); At the moment, I have no idea what I am doing with this and will mostly leave it to when I'm next with Steve, but on the plus, I now have a winning screen, even if it doesn't work yet.

Wednesday, 6 April 2011

Gaz' reply

Yo! Today I had an email off Gaz regaurding my game from the 23rd March. Between then I had made a few adjustments, so a few of Gaz's recommendations have already been completed, but here are the recommandations Gaz had for my game:

  • Fire - The player needs to shoot faster, as the Enemies shoot faster than the player. I didn't notice this until Gaz said.

  • Sounds - I've added the sounds last week (30th March 2011)

  • Health Bar - Apparently, my health bar is twice as big as it should be.

  • Adding new enemies, wepaons and pickips - At the moment I'm still trying to get my jump up to work, so I will consider more.

Right now, I'm going to change my shoot speed and make it up to speed. I've changed the speed of the bullets, so now they run at the same speed (Maybe faster) as the enemies.


I'm also trying to add another 'power up' but one that does damage rather than heal the player. I tried following the shooturial, but I might try the this.gotoAndStop(); again.


Just tried it (after filling in my Alpha testing sheet) and found the problem still doesn't work! I might change it again and I might look into creating it like an enemy.


I just realised I need to end my game. At the moment you defeat 3 mini bosses to bring the boss, and the defeat of the boss, the game should end, so I'll need to create a code to tell the game to stop when the boss is kill, much like the game over menu. I could use the code from that. I added the this.visible=false; Game.gameOver();, so now, anytime the boss is killed the Game Over screen comes on. Now all I need to do is change the Game Over screen to a Win screen. I have managed to create a function for the win screen. After trying to create the function, I managed to get it to work, but I keep getting this message in the output:


Type Error #1006: value is not a function.


at Boss/kill()


at Boss/takeDamage()


at Bullet/ enterFrame()


As I only have five minutes left of the lesson, I don't know what to do, so I'll try to finish it within the next few weeks, as next week is Easter for two weeks, back on the 27th April 2011.

Thursday, 31 March 2011

31/03/2011

Yo!
Today me and Steve have been trying to create the final score. After trying for an hour looking at the Avoider Game and Shooturial, we both decided to copy the score text and chnge them to finalScoreText. We also changed it so that the score is only visible when the game over menu is shown.Add Image

All I need to do is change the location and size for the text in the final game.

Wednesday, 30 March 2011

30th March 2011

Yo!

Today I'm working on my flash game again, working on the fine details. The problem I'm having at the moment is the jump. When I start the game I'm in the perfect position, but after I jump, my character falls off the screen so only the head is in the shot. I've changed the character's positioning on the movie clip so the cross in located in the middle of the image and have shaged the shooting so it looks like it's coming from the cross bow.




Following the Shooturial on Kongregate.com, I have managed to add sound to my level. I had to import my sound to the libaray before changing the properties so they can be linked with Action Script. I have three sounds in total, a bullet. explosion and background music. I had to name the bullet ShotSound, the explosion ExplosionSound and the background music BackgroundMusic. I then had to add the simple code of var s = new Explosion/ShotSound(); then s.play(); under the explosion/bullet function. For the Background Music I just had to add static var backgroundMusic = new BackgroundMusic(); under the public class and add backgroundMusic.play(0,1000); under the game function. Now All I really need to do is fix my jump and new game screens!!!!


I have just created a more realistic bullet for my character and enemies and have uploaded them into my game. To change the bullets was really easy, all I had to do was make a Movie Clip and in the properties was call them Bullet before deleting the graphic code used to create the orginal bullets. Here they are in game play and the original artwork










With help off Steve, I've managed to fix the enemy problem, when they run onto the new game screen. To fix this we had to remove the EnemyShipTimer from the Game Function, but keep it in the newGame function. I did this for all the timers, like the miniBoss and PowerUp. I've also gone in change some minor details such as the positioning of all the minibosses, enemies, character and bosses so they all run on the same level. I've also changed the jump with the help of Steve. After trying different code, we ended up using the code if(this.y > 220){this.y = 220}, meaning the jump show go back to the default line instead of disappearing.


The problems left:


JumpUp - I want to make the player have a reason to jump and have a little enemy to jump, so I'm hoping using the PowerUp code and change it so I can use it to make some thing to make the player jump.


Running - At the moment when left or right is holded down, the animation for the run stops on one frame, making it look wrong when playing.


After playing through the game, I decided to copy the code regarding the healthbar from the MiniBoss to the Boss, so now the Boss's health bar is much better and works now.


At the moment, I'm going to add a score on the game over screen to add more competitive game play to the game.


After trying to find out how to create the final score, both myself and Steve couldn't figure out the code, so we've decided to carry on with the game development.


My next weeks targets are:


Final Score - adding my final score onto game over screen and the win screen.


Running - I need to look at the running as when the player presses down the left or right button he stops running


Jump Up - My little jumping teaser still doesn't want to come on, so I'm hoping to improve him and start them coming on and make the player jump.

Wednesday, 23 March 2011

Creating the final assets

Yo!
Today I'm looking for sound effects for my game while waiting for help with my new game menu. I tried to find my sound from my HCI and 2D animation projects from last year, but I couldn't find them, but I did find the link I used from last year. The site was called Sound Dogs and the link was: http://www.sounddogs.com/searchresults.asp?keyword=Medieval
From that website I found three sounds, one music - Monks Chanting, this will be playing in the background as music.
Background sound effects - Battle field, this will be played to enhance the feel of battle
Crossbow firing sound- this is to make the cross bow seem more like a crossbow. I still have to add some little details in the game to make the game seem more realistic.
Pain Scream- this will be used for the explosion
I've managed to create a background animation, where a wave of allies and enemies enter the screen behind the player, running past one another and moving on. This was created by using my run animation and the enemy ship, duplicating the animation and making sure it doesn't link up to the action script. I then placed the two movie clips at 700 and -700 before placing a key frame on frame 60, and move the movie clips to the opposite number, before adding a classic motion tween. Once I created that, I placed them on a new layer before creating a new layer and scaling them down to make them smaller as they go on, making them look further away from the camera.
During testing, I found it too easy to win the game, as when the player ducks, they can shoot and move backwards, without standing, meaning the boss and mini bosses was easy to win when the player can move away from them and continue to shoot.
I decided to change the function move (e:Event). I changed
if(Key.isDown(KEYBOARD.LEFT))
{
this.x= this.x - velocity;
}
to
if(Key.isDown(KEYBOARD.LEFT))
{
this.x = this.x - velocity;
this.gotoAndStop (2);
}
This means every time the player had pressed down and left, the character will now stand back up and play my run movie clip, instead of staying on the duck movie clip. I've also added the this.gotoAndStop (2); to the jump function, meaning what button the player presses will result to the player standing back up. I've also added the this.gotoAndStop(2) to the shooting function, meaning the player now has to time their fires to survive longer. As I have a jump function, I need to create something to make the player jump. At the moment, I'm considering having a random image to jump. I created a random image of someone leing on their side, making them look dead, but trying to make it suitable for all players. I tried using the EnemyShip code, but when I tried it, it didn't work as well as I wanted, so I used the PowerUp code and renamed it JumpUp, but it still doesn't work. I'm going to wait until next week to improve the JumpUp and change the new game screen as it still doesn't work, as I never got around to changing or looking at the code.