Skip to content

Game Object Model

Elias Watson edited this page Nov 6, 2018 · 2 revisions

Model Diagram

Game

This manages a single game instance.

  • PlayerCharacter - Reference to the player's character object
  • Characters - A list of all characters in the game, including the player
  • Pickups - A list of all pickups in the game world
  • Bullets - A list of all bullets in the game world
  • Game() - Constructor. Initialize the game
  • Update() - Update the game
  • CreatePlayer(character) - Adds the player character to the game
  • AddCharacter(character) - Adds a character to the game

CharacterClass

Enum for the three character classes.

  • Gunner - Assault Rifle
  • Support - Shotgun
  • Tank - Pistol & Shield

Character

Abstract parent class of player and non-player characters.

  • Class - Character's class
  • HeldWeapon - Reference to currently held weapon
  • Armor - Is the player wearing armor
  • MaxHealth - Character's maximum health
  • Health - Character's current health
  • Score - Character's current score
  • Hit(bullet) - Called when the character is hit by a bullet

CharacterPlayer

Child of Character. Holds the player's character.

CharacterEnemy

Child of Character. Holds an enemy (non-player) character

Pickup

Abstract parent class of item pickups.

  • PickUp(character) - Called when a character touches the item

PickupArmor

Child of Pickup. Holds an armor pickup.

PickupWeaponUpgrade

Child of Pickup. Holds a weapon upgrade pickup.

Weapon

Abstract parent class of all weapons.

  • Upgradeable - Can the weapon be upgraded
  • MaxCooldown - Maximum cooldown time
  • CurrentCooldown - Current cooldown time
  • Fire() - Fire the weapon
  • Upgrade(characterClass) - Returns the next weapon upgrade for the given class

WeaponAdvancedAR

Child of Weapon. Holds an advanced assault rifle.

WeaponAdvancedShotgun

Child of Weapon. Holds an advanced shotgun.

WeaponAR

Child of Weapon. Holds an assault rifle.

WeaponKnife

Child of Weapon. Holds a knife.

WeaponPistol

Child of Weapon. Holds a pistol.

WeaponPistolShield

Child of Weapon. Holds a pistol & shield.

WeaponShotgun

Child of Weapon. Holds a shotgun

Clone this wiki locally