This is a screenshot of the start screen for my game. The start screen displays the high scores for the game and it displays text telling the player how to being the game.
This is a screenshot of the comet stage in my game. The comet stage lasts for 60 seconds. During the comets stage, comets will travel horizontally towards the player. If the player comes into contact with a comet the player will lose a life. The aim of the comet stage is to survive until the end of the 60 seconds without coming into contact with the comets.
This is a screenshot of the saucer stage in my scramble game. The saucer stage is 60 seconds long. The saucers move horizontally across the screen towards the player in the movement of a sine wave pattern.If the player comes into contact with a saucer then they will lose a life. If the player shoots a saucer it will be destroyed and the player will gain 20 points.
A screen shot of the Boss stage.The boss has 20 health and loses one point of health every time its weak point is hit by a bullet, if the boss is destroyed the player is awarded 200 points. A shield will appear for ten seconds every five seconds which blocks the bosses weak point. If the player is hit by a bosses bullet then they will lose a life. The boss fires from one of the nine guns on it, this is determined by a random number being generated every 0.5 second. While in the boss the player is not allowed to move horizontally, the boss also will never move. The aim of the boss stage is to destroy the boss.
This code is an example of the code that I used to spawn in each object. Every object was given unique values and textures. The values set here then affected the object for the entirety of the time that it is present in the game, except for the position as this will be changed when the object moves.
Here is a screenshot of my "Upon Death" and "High scores" code. If the player loses all of their lives then the game is over. The program first checks to see if it is the boss stage, if it is then the boss will be destroyed. The ships position will then be set to the default position and the variables "iLives" and "iStageCounter" are reset. For high scores the program tests to see if the current score is higher than any of the high scores already stored. If the current score is then it will be placed into the high score table and all lower scores will be moved down the high score table by one, the variable "iScore" is then set to 0.
Here is a screenshot of my collision code. The program creates two temporary "GameObjects" to hold the information for the two objects colliding. The program will then proceed through a number of if statements to determine what objects are in the collision. If I was to re-write this code I would first check to see what stage the player was in, as only certain objects can be in each stage, and then I would use a switch statement to determine the objects rather than a load of if statements.
This is my object deleted code, anytime that an object is destroyed this function is called. The program assigns the object to a temporary "GameObject". The program then tests to see if either of the Booleans "bCometStage" and "bSaucerStage" are true, if they are true then the game is currently in either the saucer or the comet stage. If one of these Booleans are true then the program tests to see if it is comet/saucer that has been destroyed, if it is then a new comet/saucer is spawned into the game.
This is my C++ code to determine which gun the boss uses during the boss stage. Every 0.5 second this code is run. The boss fires a bullet depending on what the current value of the variable "iBossShootLocation", the clock used to time how long it has been since the previous bullet was fired is then restarted. The variable "iBossShootLocation" is then given a random interger value between 0 and 8.
Here is a screenshot of my C++ code for a break. when the player ends a stage or starts the game the variable "iStageCounter" will be set to a value equal to that of a break stage. When in the break stage an SFML Clock will start and after five seconds the stage will change to the next game stage and the clock will be reset.
This is my C++ code for the comet stage. The stage begins by spawning a comet in every 0.825 seconds for the first 8.25 seconds on the stage, this results in 10 comets being on the screen at the same time. The speed of the comets will be increased depending on the value of the integer "iRoundsDone". The comet stage is then continued for the next 51.75 seconds at which point the stage will move to a break stage. When a comet is destroyed the "objectDeleted" function is called.
Here is my C++ code for the saucer stage. For the first 7.2 seconds of the stage the program spawns in a saucer every 0.6 seconds, this results in 12 saucers being on the screen at one time. The stage continues for the next 52.8 seconds. When a saucer is destroyed the "objectDestroyed" function is called.
This is my code for the movement of the saucers. The saucers move in a sine wave pattern across the screen from right to left. The position of each saucer is changed each 0.1 second, this gives the saucers a fluid movement.
gLike
Scramble - Arcade Game - C++

Scramble is a 2-D side scrolling arcade game from the 1980s. I have recreated it in Visual Studio using C++, SFML and an arcade SDK. This was an individual project created between March 2014 - May 2014

There are four different game stages: Comets, Saucers, Boss and Break.

The break stage is a five second window between each stage to give the player a short rest between stages. There is a break stage after every round.

Every second that the player survives they are awarded 20 points.

When the player has completed the boss stage they will have a break stage and then start the comet stage over again, the speed of the comets and saucers will be increased every time the boss stage is completed.

Gethin Watkins
Student Leicester, United Kingdom