Monday 26 October 2009

day 4 : 2D game update

So guys I have started working on the main menu. I am going to get some placeholder graphics up and running and then hopefully get an artist to draw me up some cool things for my buttons and my backdrop for the menu. This is quite easy.

What I am doing is I am using an integer value named GameState. This is initially set to 1 which happens to be the main menu state. This right now shows up the basic blue screen. But when I then set the GameState to 2 it draws everything the game usually shows and takes input as normal. I can then take this further by having a GameState 3 which I could use as a pause state etc. This is a very simple solution to my main menu problem and it is one that I used in my First game of Pong. Although for the way I have coded this I do not like it. It means I have weird if statements everywhere whereas if I had everything set in appropriate public voids. Then it would be a lot better/cleaner.

For instance I would rather have

if ( GameState = 2 )
{

takeinput();
drawgame();
setlevel();
docombat();

}

whereas for the most part I have

if ( GameState = 2)
{

Then quite a lot of code.

}

So in my next game I am going to resolve this at the very outset. Then hopefully I can utilize this to a greater extent in my next games.

Anyway a quick screenshot to show you how the game is progressing. This contains placeholder graphics so try and use your imagination when looking at it. I will however have a download within the next 2 weeks so that you guys can have a shot at my game :D




More updates tomorrow!

Bye for now!

No comments:

Post a Comment

money maker