So now after completing Two Player Pong, (I solved the alt-tab problem just now in about a minute. All I needed to do was check for keyboard focus. Idiot.), I am onto Breakout. This time though I have a rough (and quite ambitious) plan instead of stumbling about like a blind man who has just done five rounds with Mike Tyson.
I warn you, this could look a bit messy, just like on the paper in front of me.
Title Screen - The title screen will have four options: play, password, high score and quit.
Events to handle: Window close/Esc - quit the game, Up - set the next menu item to above, Down - set the next menu item to below, Enter - select current menu item.Logic: Check to see if next menu item is possible - if yes, set it as suchRender: Draw background, draw arrow in the right placePassword - Each level will have a password so the player can skip levels they have already completed
Events to handle: Window close, Esc - to title screen, Letters - player wants to put in a letterLogic: Add the letter to the code, if the code is finished check if its validRender Draw background, draw code
High Score - Record of player name, score and date(?)
Events to handle: Window close, Esc - to title screenLogic: Read high score from fileRender: Draw the names and scorePlay - The levels will be in a file with the layout written in numbers (0 = empty, 1 = red etc). I hope to include power ups in the game.
Events to handle: Close window, Esc - Make sure they want to quit - to title screen, left and right - player wants to moveLogic: Check to see if player can move, Check ball collision w/player (yes - rebound), w/block (yes - rebound and destroy block, increase score), w/wall (yes - rebound), w/bottom of screen (yes - lose life, new ball)Render: Draw background, level, ball, player, score and livesSo that's the plan, it's very sketchy at the moment and a lot more details are needed in the implementation of certain things. But I will probably make these up as I go along through trial and error.
Thanks for reading.
-AEdmonds