1      Introduction. 2

2      Overview.. 2

3      Functional Requirements. 3

3.1       In Game Functions and Components. 3

3.1.1        Aircraft Control 3

3.1.2        Air Objects. 3

3.1.3        Ground Objects. 5

3.1.4        Weapons. 5

3.1.5        Bonus Packs. 6

4      Nonfunctional Requirements. 6

5      System models. 6

5.1       Scenarios. 6

5.1.1        Brief Scenarios. 6

5.1.2        Play Game Main Success Scenario: 7

5.1.3        Change Options Main Success Scenario: 8

5.2       Use case model 8

5.3       Dynamic models. 9

5.3.1        Sequence Diagrams. 9

5.3.2        Activity Diagrams. 18

5.4       Class model 20

5.5       User interface - navigational paths and screen mock-ups. 21

5.5.1        Main Menu. 21

5.5.2        Load Game. 22

5.5.3        Options. 23

5.5.4        Game. 24



1         Introduction


The Revenge of Birds is an arcade game that is inspired by the game Chicken Invaders 2.   However, in this game scenario is the invasion of earth by birds having bird flu rather than invasion of solar system by chickens.  Since birds are tried to be annihilated by human beings using a special type of flu, birds decided to invade earth and take revenge from humans.  The way they chose is using human’s flu as a weapon against humans. 

In the game, earth is under control of birds.  Player should use the aircraft to destroy the birds all over the world.  In each level of the game, an invaded area of earth should be saved.

We decided to select this game as our course project since in arcade games there are several object interactions and hierarchies.  Therefore, we would practice our object-oriented design knowledge effectively.



2         Overview

            In the game user controls an aircraft and tries to eliminate the birds coming from the top of the screen.  User has a limited health level which decreases immediately as the birds or their eggs hit the aircraft. During the game, player can increase the health level by taking energy packages as bonus. However, if a bird itself hits the aircraft, aircraft pilot is infected by the flu, which causes degradation in health level constantly.  To be cured, player should take cure kit. When player’s health level becomes zero, game ends.

The birds hitting the aircraft will cause an energy loss in health level.  Therefore, player should try to escape from them.

Moreover, there are ground objects in the game such as ostriches and farms.  Those ground objects does not collide with the aircraft, but they have bonus packs that can be gained when the player kills these ground objects.



3         Functional Requirements


In this section, we describe the components of the game in detail.

3.1      In Game Functions and Components

3.1.1      Aircraft Control

In the game, the player controls the aircraft by mouse. Using mouse will decrease the effect time of player. By putting our game only two optional keys, left and right mouse key make our game playable for children. Left mouse key is being used for shooting enemy birds and right key is being used for firing mass destruction weapons (bombs).


3.1.2      Air Objects

These objects are located in the air. This part includes the aircraft and the enemies. The aircraft can hit all of these objects or it can shoot them by using weapons.


       Aircraft: It is the plane, which is controlled by the player. It has different types of weapons to eliminate enemies. It has a health level and when the aircraft is hit by any of birds or eggs, its health level decreases. If the health level becomes zero, then the aircraft explodes.



       Infected Chicken: This is an infected chicken that throws eggs to the aircraft. If the aircraft hits one of these eggs, its health level decreases. Additionally, this chicken has the bird flu and if it hits the aircraft, it makes the aircraft infected. After this, the health of the aircraft starts to decrease in time unless a cure kit is gained.



 Pigeon: Pigeons are the birds that can throw eggs and decrease the health of the aircraft. Pigeons are not infected by flue so if they hit the aircraft the pilot does not become infected. So the harm that they gave to the aircraft is lessening the health level suddenly for once.






Ducks: These are some of the birds, which are not infected. Therefore, they cannot make the pilot infected. Their eggs are their weapons to be used against the humans.

 Infected Parachicken: These birds have their parachutes, which protects them against the aircraft’s weapons. However, when they loose their parachutes they can be killed. Therefore, at first shot the parachute is thrown so that at the second shot the bird can be killed by the aircraft.



 Fertilized Egg: If the aircraft shoots the egg, then the bird inside the egg starts to fly like other birds. This bird inside the egg is not infected so it cannot use flu as a weapon against the human.



 Boss Dodo: Boss Dodo birds are the strongest birds among the others. These birds are encountered at the end of each level. So killing a Dodo is harder than killing the other kinds of birds.



Eggs: These are the eggs that are thrown by the birds. If they hit the aircraft, they decrease the health of the aircraft.










3.1.3      Ground Objects


These are the objects located on the earth.  Ground objects does not hit to the aircraft, however, aircraft can shoot them using any weapons.  By shooting them, player can gain bonus packs and extra points.


Ostrich:  When these birds are shot, user gains extra points and there may appears a random weapon pack, a cure kit or an energy pack on where animal used to be sitting. An ostrich can be killed by two rockets.



Farm:  These buildings are considered as infected bird sources in the game scenario.  Therefore, player should try to destroy them.  By shooting the farms, player gains points. Moreover, an energy pack, a cure kit or a random weapon pack may be gained. A farm can be destroyed by five rockets.


3.1.4      Weapons


These are the tools on the aircraft to shoot the targets on the screen.  All of the weapons can be used against both ground and air objects. 


All the weapons except the Nuclear Bomb are called “guns” and controlled by the same mouse button whereas a second button is assigned for the Nuclear Bomb.


Aircraft can have only one gun at a time.  To obtain a new gun user should use bonus packs.  By taking the bonus pack for the same gun owned by the aircraft, power of the gun can be doubled.


Rocket: The basic and default weapon.  Only one rocket can be fired during a second.


Machine Gun: This is a faster gun.  Each bullet has the half power of a rocket; however, four bullets can be fired during a second.


Marten Gun: A gun that has the same power and speed with the rocket, however, unlike the other guns, it can hit to multiple objects.  After a Marten Gun rocket hits a target, it gives damage to its target as a rocket; however, it continues its movement without loosing its energy.  Therefore, if there are n objects in a column, all objects gets the damage as if all of them are hit by a separate Rocket.


Nuclear Bomb:  Gives all ground and air objects damage equal to the damage of the two rockets.


3.1.5      Bonus Packs


            In the game, there exist some ground objects like ostriches and farms. If the player can shot these objects, then the player has a chance to gain some bonus packs, which are very helpful for the player since they provide health and weapon support. These bonus packs are stated below.


Energy Pack: Whenever the aircraft is hit by any of the birds, there occurs a decrease in the health level. The game serves an energy pack to the player, which increases the health level back, and this pack can be obtained from ground objects during the game.


Cure Kit: If a bird with flu, hits the aircraft by itself, then the player as the pilot of the aircraft also is inflected by flu. This inflection causes degradation in the health level. If the player could not be able to prevent this suffering then there is a chance to gain a cure kit to be used against this flu, again from the ground objects. This cure kit is just to halt the degradation in the health level. 


Random Weapon Pack: This pack is used against suffering from birds. To prevent being inflected or being hit by the birds the player can gain strong weapons from this pack.  This pack can also be obtained from the ground objects and it includes more effective weapons against the birds.


4         Nonfunctional Requirements


The Revenge of Birds is a game especially for children. A good interface is needed. Game menu should be prepared as articulate and simple as possible to let also the young players play this game easily. The players should be able to find out what they must do with this game whenever they browse around the interface of the game. All the paths of the game should be comprehensible. The game is expected to have a high performance rate. 


5         System models

            This section includes Use Case descriptions, main success scenarios of Use cases and their extensions. In addition, some brief scenarios are stated below. These scenarios give some ideas that would also be used for the design stage of the project.





5.1      Scenarios

5.1.1      Brief Scenarios


1. The player starts a new game. Player controls the aircraft, moves forward, left and right not to collide with any birds. However, the player is first hit by an infected chicken. Health level decreases because of this hit and degradation in the health level starts. Then aircraft hits to a duck this also damages the pilot. The health level again decreases because of this damage. Then a pigeon hits the aircraft. Again, damage causes a decrease in the health level. In time, the health level gets zero because of the degradation and the game ends.

2. The player starts a new game. An infected chicken and pigeon are shot by the player. The player gets point. Then an infected parachicken hits the aircraft. The pilot is infected by flu. This cause degradation in health level of the player. Then the player shoots an ostrich on the ground and gains cure kit. This stops the degradation in health level. After some more shoots player kills some other birds and gains more points. Then the player reaches the end of the level and meets the “Boss Dodo”. The player cannot manage to kill Dodo but Dodo kills the player and the game ends.


3. The player starts a new game and shoots several birds then gets many points the fertilized egg hits the aircraft then another bird comes out of this egg and this bird hits the aircraft. The health level decreases. Then the player fires the farm on the ground and gains a weapon pack. By this weapon support the player, manage to kill the Boss Dodo that comes out at the end of the level. The player gains a bomb by his points; the player uses his bomb and kills the birds around.  Then the player fires the farm on the ground and gains an energy pack. This suddenly increases the health level. After killing some more birds the level ends and the Boss Dodo appears again. The player kills the Dodo by his weapon and bomb. The game ends.


5.1.2      Play Game Main Success Scenario:


  1. The player starts a new game.
  2. The aircraft starts to move and the player controls the aircraft.
  3. Different kinds of birds start to attack the aircraft.
  4. The player shoots the birds and kills them.
  5. The aircraft shoots the birds on the ground.
  6. The player gains bonus packs.
  7. The player wins the game with a nonzero health level.



*a Any time the player presses esc

            1. An In game menu appears

            It does not disappear until the player chooses one of the options of this menu.

2a. The player moves the aircraft forward, right and left.

3a. Infected birds like chickens, pigeons, ducks, parachickens approaches to the aircraft to make the pilot infected by their virus and decrease health level. The birds move differently and randomly to attack the pilot.

3b. Chickens’ eggs hit the aircraft and lessen the health level of the pilot of the aircraft.

4a. The player shoots the birds like infected chickens, infected ducks and infected pigeons by the weapons.

4b. The player shoots the infected parachickens and these birds looses their parachutes so that they start to approach to aircraft faster. Then by the second shot, they are killed by the player.

4c. The player shoots the fertilized eggs and birds come out of these eggs. The second shot kills them.

4d. The player encounters the bird “Boss Dodo” at the end of the levels, which can be killed by more than one shot.

4e. The player can not shoot some birds these birds continues to approach the aircraft, not to hit these birds, pilot changes the directions by controlling the aircraft.

5a. The player shoots the ostriches on the ground and kills them.

5b. The player shoots the birds in the farm on the ground.  

6a. The player gets a weapon pack as a bonus pack from the ground to attack back to the birds.

6b. The player gets a cure pack, which will stop the degradation in the health level.

6c. The player gets energy pack, which increases the health level of the player.

7a. The player wins the game with a high health level

            1. The player presses esc to see in game menu and chooses the exit option.

7b. The player exits the game by saving it.

7c. The health level gets zero so the system automatically exits the game.




5.1.3      Change Options Main Success Scenario:


1.      The player clicks on change options button in the main menu.

2.      The player changes the options.

3.      Player turns to main menu after changing options.    



*a Anytime player presses on esc;

            1. Player turns back to main menu.

 2a. Player changes sound options.

            1. Player sets the sound on.

            2. Player sets the sound off.

2b. Player sets the music options.

1.      Player sets the music on.

2.      Player sets the music off.

2c. Player speed of the game.

1.      Player decreases the speed.

2.      Player increases the speed.

3a. Player clicks to back button and turns to main menu.




5.2      Use case model


We can collect various scenarios in two use cases: Play game and change settings.  In brief format, they can be explained as follows.


5.2.1      Play Game


By either loading or starting a new game, player starts playing game.  Player controls the aircraft and he/she tries to shoot enemy birds, ground objects, and tries to collect bonuses.  In various points game level changes and player begins a new level.  By passing all levels, player finishes the game.


5.2.2      Change Settings


In settings window, user opens or closes music and sound effects of the game.  In addition, user changes the speed of the game.  User returns to the main menu.


5.2.3      Use Case Diagram


Use cases of this system can be visualized in the following diagram:






5.3      Dynamic models


5.3.1      Sequence Diagrams


In this part, we tried to cover numerous short scenarios using sequence diagrams to discover the natural division of the problem into components.  Start a new game


In this scenario, player Recep starts a new game using the main menu.  In the sequence diagram, creation of necessary objects for initializing the game is shown. 


GameEngine is the component designed to be responsible for general processes in game.  Therefore, it does a set of operations periodically.  run()” is the thread method of this classes.  Those processes can be summarized as the follows:


-                     Moving aircraft according the displacement in the mouse. (moveAircraft():void)


-                     Firing a bullet from AirCraft or using a bomb according to the usage of the mouse.

-                     Using Level object, adding new game objects (i.e. birds and ground objects) to the scene when necessary.  Level object stores the information of the game objects to be added at specific times. (addNewObjects():void).  It uses getCurrentSceneObjects():List<GameObject> method of Level object to get the list of new items.  Each update of level object corresponds to stepping forward in time.  Moreover, in each step, it should be checked whether is there any object in the queue to detect the end of the level.

-                     Triggering update() method of all GameObject’s which provides the internal update of each game object and Level object.  Therefore, each game object (except AirCraft) is responsible for changing its own position and visual image. (updateObjects():void)

-                     Checking collisions between the aircraft and the enemy objects (birds and eggs).  (checkEnemyObjectsCollisions():void)

-                     Checking collisions between bullets shown in the screen and game objects. (checkBulletShoots():void)

-                     Checking collisions between bonus objects shown in the screen and the aircraft. (checkBonus():void)

-                     Checking all objects’ status and removing the destroyed ones from the list (removeDestroyedGameObjects())

-                     Calling repaint(List<GameObjects>objects):void function of PlayFrame at each run() iteration to update the GUI of the game.


To make the diagrams simpler, only the related steps of these processes are shown in each sequence diagram.  Fire a bullet


In this scenario, Recep left clicks to fire a bullet.  In this scenario, only the creation of the bullet is covered.


Since GameEngine guarantees the synchronization of the system, mouse click is handled in the first next iteration of the GameEngine thread.  MouseHandler’s thread only stores the information that mouse is clicked during the period between two run() iterations.
  A bullet shoots a ground object and destroys it


In this scenario, a bullet previously fired by the player Recep, collides with a ground object (an ostrich on the ground) during its movement.  Because of the damage of the bullet, ground object’s health becomes zero.

  Move aircraft and collide with an infected chicken


In this scenario, player Recep moves the aircraft that results in a collision with an infected chicken.  According to the given sample values in the sequence diagram, because of the collision, aircraft takes damage having value 30.  Moreover, since the bird is infected, aircraft starts to loose health periodically.  This degradation of health is updated by the update() method of AirCraft object in each iteration of the GameEngine thread.
  Use bomb and destroy a duck


In this scenario, player Recep uses a bomb and resultantly all objects gets damage.  Moreover, a duck in the scene is destroyed by the damage of the bomb.  A chicken leaves an egg


In this scenario, a chicken leaves an egg in the screen.  This diagram visualizes the special requirement for chicken that should be considered in the design of GameEngine.  Each bird’s getEgg() should be called in each iteration of the GameEngine thread.  If bird does not leave an egg, then the method should return null reference.
  Aircraft takes a weapon bonus


It is assumed that because of the destruction of a ground object, there is a weapon bonus pack in the scene.  In this scenario, aircraft takes the bonus pack by colliding with it.
  Successful completion of Level 1


In this scenario, first level of the game is successfully completed after the destroying or passing all the incoming enemies.  Assumption is that there are no enemy objects in the current scene.  The end of the level is detected by using hasMoreObjects():bool function of the level1 object.





5.3.2      Activity Diagrams  Main Function Activity Diagram  Play Game Activity Diagram



5.4      Class model


In this section, according to the analyses in the Dynamic Models section, a brief class model diagram is provided.  We believe that this diagram would help for obtaining insight about the system.




5.5      User interface - navigational paths and screen mock-ups

5.5.1      Main Menu

            This game has a main menu including start game, load game, options and help choices. Start game choice constructs a new game for the player. It starts a new game; the player starts the game with full health level but undeveloped weapon. During the game, we have opportunity to develop weapons and increase our health level, which is decreased during birds’ attacks. Load game choice gives a chance to the player to start the game that was saved before. By options choice, player can set sound music and game speed settings.


 Figure 1. Main menu screen shot


5.5.2      Load Game

            This mock-up shows the load game menu. In this interface there exist two buttons; one for load game and the other for go to main menu. Also there is a label in which the last saved game’s date is stated. The player clicks on the load game button and continues to play the last saved game.




   Figure 2. Load Game screen shot




5.5.3      Options

            When the player chooses the options from the main menu frame which is placed below appears. Using this interface, the player can change sound music and game speed settings.



Figure 3. Options screen shot



5.5.4      Game


  Figure 4. Game screen shot