Skip to content

Game Class Structure

As we have developed our game, the different parts that are active in our process are getting harder to track of.
Therefore I will be making a UML in this document to indicate the different classes, inheritances and dependencies in one clear overview.

---
title: Micro Mayhem diagram
---

classDiagram
class Player{
    -Weapon _weapon
    -RigidBody2D _rigidbody
    -Camera _camera
    +float movementSpeed
    -Vector2 _moveInput
    -Vector2 _aimInput
    -InputBindings _bindings
    -float _maxHealth
    -float _health
    +float MaxHealth
    +float Health
    +int _lives
    -PowerupUpdate()
    -GetMoveInput()
    +Damage()
    +CollectData()
}

class Score{
    -int _score
    +int Value
}

class Powerup{
    +Player player
    +float threshold
    +PowerupType type
    +float powerupValue
    -Powerup nextThreshold
    +List<int> applyEffects
    +Powerup[] powerupArray
    +List<Powerup> powerupList
    -string liststring
    +ApplyPowerups()
    +SaveCurrentPowerup() 
    +GetPowerUp()
    +CheckNextPowerup()
}

class Neardodge{
    -RigidBody2D _rigidbody
    -SpriteRenderer _spriteRenderer
    +Player player
    +Create(Player playerComponent)
}

class Enemy{
    +float maxHealth
    +int score
    -float _health
    _float damage
    +float Health
    +Initialize()
    +Die()
    +Damage()
}

class SlidingEnemy{
    +float speed
    -RigidBody2D _rb
    -Vector2 _direction
}

class HUD{
    +Canvas canvas
    +DoubleGauge HealthBar
    +TMP_Text TimerText
    +TMP_Text ScoreText
    +TextMeshProUGUI livesText
    +Initialize()
    -CreateTimer()
    -CreateHealthBar
    -ShowLives()
    -CreateScoreText()
}

class DoubleGauge

class MonoBehavior

Last update: June 2, 2023