Class Hierarchy - mcc-computer-club/summer2013-arcadegame GitHub Wiki

Main ()

{

}

Basic Object :if you need me to explain these variables, let me know.

{

 1. xposition int variable

 2. yposition int variable

 3. xspeed int variable (updater for the x-position variable)

 4. yspeed int variable (updater for the y-position variable)

 Method: display_sprite (-unsure as of yet what goes into this)

}

'''

Note: as of now I have one player object that is a child to the Basic object. However as we are planning to have more than one character, it may be a good idea to have either the specific players be children of the player object, or if they are different enough, several different player objects. More info is needed, personally I suggest the former.

'''

Player (child of Basic Object)

{

 // additional variables

 MAX_SPEED Constant: this is checked against to prevent the player from moving too fast. 

 MAX_HEALTH: probably want something like this.

 variable int y-relspeed: updater variable for the y-speed of the player object

 variable int x-relspeed: updater variable for the x-speed of the player object

 variable int player defense/shields/health: generally in these games there are two separate types of health.

 variable int player defense/shields/health: generally in these games there are two separate types of health.

 variable int player-weapon: this number is checked against when the fire method is called,

 variable Boolean weaponswitch (true/false) changes direction that it switches.

Methods

 ** method animate () //possibly needed.

      {}


 ** method Fire (player-weapon) //takes player weapon number, and creates an instance of the corresponding bullet by calling on the method for the weapon fired (each weapon should have its own method to keep this method from becoming too large and unworkable, it also allows more configurability of each weapon.

      {

      if (1)

         weapontype1

      else if (2)

         weapontype2

      etc.

       }


     ** method weapontype1,2,3,4:

     {

     specifics of how weapon works

     }

    ** method switchweapontype(weaponswitch)**

     {         

     if true

      player-weapon += 1;

     else if false

      player-weapon -= 1;

     update picture on hud(player-weapon)

     }

    ** method move (data from controller, I have no idea how to do this)**

     {

     }

     **method ship-is-hit (hit) (hit is an undeclared variable, the point of it is that depending on the number, it will have varying effects on the ship. 1, +10 to health, 2 +20 to health, 3 +30 to health, 4 -40 to health. In short this method accounts for both bonuses and enemy ships.**

     {

     if (hit == 1)

     do this

     if (hit == 2)

     do this

     etc.

     //probably want to include some kind of check agains the maximum health of the ship.

     }

'''

For the players weapons, there are other options, I chose what I think is the best one.

'''

     }

####Enemy (child of basic_object)too different from player, needs own methods and variables.

{

variable int enemy_type

variable int enemy_health

method display enemy(enemy_type)

{

-meant for choosing the specific sprite of the enemy, called on when enemy is created, player should have such a method too.

}

method fire (enemy_type) //chooses the bullet type, from the type of enemy it is.

{

}

method behavior (enemy_type) // different enemy types will have different behavior, some will change movement relative to the player. In order to keep this method from becoming too clogged to use, have it call on a separated method for each enemy type. Even with this, bosses may need their own class.

{ }

methods enemytype1,2,3,4

{

}

}

Movie (child of basic_object)

{// basically, it shows a cutscene and disappears when done.

method movietype (x)//different inserted numbers will have it play a different movie.

{}

}

Level object (parent class)

{

method readfile () //not sure yet what goes into this, but it needs to be able to read a text file, and create a level based on it.

{

}

}

Menu Object (parent class) -simple relatively //incomplete.

{

variable int buttonselected.

method for displaying buttons:

}