Wednesday 18 September 2013

The Attack of The Dragon Gryzko

Today I combined all the knowledge I gathered over the past few days and put it all together in one game: The Attack of the Dragon Gryzko. A game where you have to hunt down a mighty dragon attacking your castle by using your magical power.

Game setup code

Above is the initial setup of the game. Resetting score to 0, Time 30 seconds, Amount of ammo you have and Health. I also created the timer in this code, so the variable timer will decrease every time one second passes. To the right is the code that defines when the game is finished and, at the left bottom is the high score table.

Since I wanted Gryzko to attack me and increase the difficulty of the game, I had to give him a flame strike that deals 10 damage to me. And also I had to set up how I would score whenever I hit the mighty dragon.
Attack damage1
Random attack

For the Health, I used the same script posted previously in my blog. Next, I created a code to control how to reload and decrease ammo after every shot, that is described in the picture below.

Reducing ammo

And finally I created the code to decrease the amount of lightning bolts you have before reloading. Also I added a different time for each sprite to appear, creating a nice little animation.

Reloading

You can find the game below:

No comments :

Post a Comment