This blog will record my progress as I attempt to make my Pseudo 2.5D game in DirectX for my C++ coursework. If you like this software and blog please donate to Cancer Research UK through the following link: http://www.justgiving.com/game4cancer
Wednesday, 27 October 2010
A finite state machine for previous states and pseudo code
case START:
-Load Start Screen-
if(PlayerClickHighScore)
{
state = HIGH_SCORE;
}
else if(playerClickStart)
{
state = GAME_LOOP;
}
break;
case HIGH_SCORE:
-Show high scores-
if (PlayerClickPlay)
{
state = START;
}
break;
case GAME_LOOP:
-Do game actions-
if(PlayerPressESC)
{
case = START;
}
else if(PlayerPressPause)
{
set gameispaused = true;
state = PAUSE;
}
else if(timer = 0)
{
case = GAME_OVER;
}
break;
case PAUSE:
-Pause game-
if ((gameispaused = true) && (PlayerPressPause))
{
case = GAME_LOOP
}
break;
case GAME_OVER:
-show game over screen-
if(score > lowestHighScore)
{
Enter initials;
case = High_SCORE
}
else
{
case = START;
}
break;
The point of this pseudo code is to give me a base to structure my code so that it decreases complexity.