Introduction:
In the Introduction GameState a series of screens show up one after another (this will give a story, if any).
Pressing enter at any time will go to TitleScreen.
Private: array of Frames (see below) (ie [frame1][frame2]...[frame n]) and 3 x Surface Pointers (currentFrame, nextFrame, screen).
Logic() will see if the delay time (in the Frame class) has expired and then change currentFrame and nextFrame
Render() will just draw the currentFrame
class Frame:
The Frame class will have a surface pointer to the image and a delay time that will indicate how long the frame should be shown.
TitleScreen
The TitleScreen will work the same as in Breakout. There will be three options (Play, High Score, Quit).
Private: 3 x Surface Pointers (screen, background, arrow), int choice (0=Play, 1=High Score, 2=Quit) (start at 0) and int nextChoice (starts at 0 too)
Input: Up - go up a choice (nextChoice = choice - 1), Down - go down a choice (nextChoice = choice + 1), Enter - Select choice
Logic() will check to see if nextChoice is a valid number (yes: choice = nextChoice, no: nextChoice = choice)
Render() will draw the background and draw the arrow at choice
class Score
This will contatin a char[3] for the player's intials and an unsigned int for their score
class HighScores
(I think) there will be one global instance of this.
Private: vector of 5 Scores.
The functions required for this class will be to load scores from file (put this in the constructor?), write scores to file, print scores, add a score (sort here maybe?), sort scores, check a score is high enough
HighScoreScreen
Private: 2 x Surface pointers (screen, background).
Calls to HighScores will be: print scores
Input: Enter - Return to title screen
GameOver
Private: 2 x Surface pointers (screen, background)
Print player's own score
Calls to HighScores: check a score is high enough - if yes: ask for initials, receive initials, add score
Input: Enter - Return to title screen
LevelStart
Render: Draw Background(scrolling), Draw Player, Draw 'LEVEL #'
Logic: Delay then go to LevelPlay
LevelEnd
Render: Draw 'LEVEL # COMPLETE', show how many of each enemy destroyed, total up the score, show, current hit %
LevelPlay
Input: Left/Right - move player left/right, Space - fire weapon
Logic: Move enemies, collision detection, move background
Render: Draw score, lives, player, enemies, background
class Ship (Player and Enemy inherit from this)
Private: image, health, Bullet, rate of fire
Functions: Move(destX, destY) will move the Ship to a destination point, FireWeapon(), Draw()
class Bullet
Private: image, strength
Functions: Draw(), Move()
Collision Detection
This will take a Bullet and a Ship class and see if they have collided or will collide.
class Player
Extra stuff added to Ship: hit%, score, enemies destroyed
class Enemy
Extra stuff added to Ship: Movement Pattern, EnemyState
MovementPatterns will just be a list of (x, y) coords to follow for different paths (eg, straight line, loop etc)
EnemyState - Entering/Leaving, firing, stationary (small movement around a central point), charging (follow player)
class Boss
Extra stuff added to Enemy: Weak Points (essentially Enemies for collision detection purposes I think)
Possible Powerups: increase rate of fire, invincibilty, shield
As you can see this is a very broad plan and there are only musings on how it will work in detail. At the moment I'm not sure whether to jump in headfirst and sort out these details or sort them out now. Come to think of it, I did the former last time and it didn't help me. So I'll try and sort out some of the details over the next couple of days.
Thanks for reading this long post.
Any comments/suggestions on anything in the plan would be appreciated.
-AEdmonds