0% found this document useful (0 votes)
5 views2 pages

Game Object Class

Game class object

Uploaded by

ladnp14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Game Object Class

Game class object

Uploaded by

ladnp14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Game Class Object

Here's a breakdown of the classes and their relationships for the Dynamic Difficulty
Adjustment feature:

Classes:

1.​ Player:
○​ Attributes: health, damageDealt, accuracy, resourcesCollected,
deaths, level
○​ Methods: takeDamage(), dealDamage(), collectResources(), die()
2.​ DifficultyAdjuster:
○​ Attributes: currentDifficultyLevel (float between 0 and 1, where 0 is
easiest and 1 is hardest), playerPerformanceData (collection of
PlayerPerformance objects)
○​ Methods: calculateDifficulty(), adjustEnemyAI(),
adjustResourceDrops(), adjustGameParameters()
3.​ PlayerPerformance:
○​ Attributes: health, damageDealt, accuracy, resourcesCollected,
timeElapsed (snapshot of player stats at a particular moment)
○​ Methods: (Data container; primarily accessed by DifficultyAdjuster)
4.​ EnemyAIController:
○​ Attributes: aggressionLevel, reactionTime, attackFrequency
○​ Methods: setAggression(), setReactionTime(),
setAttackFrequency()
5.​ ResourceManager:
○​ Attributes: dropRate, resourceQuantity
○​ Methods: setDropRate(), setResourceQuantity()
6.​ GameParameterManager:
○​ Attributes: enemyHealthMultiplier, damageTakenMultiplier
○​ Methods: setEnemyHealthMultiplier(),
setDamageTakenMultiplier()

Relationships:

●​ Player --1.. PlayerPerformance: A Player has multiple PlayerPerformance


snapshots over time.
●​ DifficultyAdjuster --1.. Player: The DifficultyAdjuster tracks the Player's
performance.
●​ DifficultyAdjuster --1.. EnemyAIController: The DifficultyAdjuster adjusts the
EnemyAIController.
●​ DifficultyAdjuster --1.. ResourceManager: The DifficultyAdjuster adjusts the
ResourceManager.
●​ DifficultyAdjuster --1.. GameParameterManager: The DifficultyAdjuster adjusts the
GameParameterManager.
Class Diagram (Textual Representation - Imagine this visually):

+-----------------+ +--------------------+ +-----------------+


| Player |-----| PlayerPerformance |-----| DifficultyAdjuster |
+-----------------+ +--------------------+ +-----------------+
| health | | health | | currentDifficulty |
| damageDealt | | damageDealt | | playerPerformance |
| accuracy | | accuracy | | calculateDifficulty()|
| resourcesCollected| | resourcesCollected | | adjustEnemyAI() |
| deaths | | timeElapsed | | adjustResourceDrops()|
| level | | | | adjustGameParams()|
+-----------------+ +--------------------+ +-----------------+
* * *
| | |
1 1 1
| | |
+-----------------+ +-----------------+ +--------------------+
| EnemyAIControl |-----| ResourceManager |-----| GameParameterManager |
+-----------------+ +-----------------+ +--------------------+
| aggressionLevel | | dropRate | | enemyHealthMult |
| reactionTime | | resourceQuantity | | damageTakenMult |
| attackFrequency | | | | setEnemyHealth() |
| setAggression() | | setDropRate() | | setDamageTaken()|
+-----------------+ +-----------------+ +--------------------+

Explanation of Relationships:

●​ The * symbol indicates a "many" relationship. A Player has many PlayerPerformance


snapshots.
●​ The 1 symbol indicates a "one" relationship. The DifficultyAdjuster tracks one Player
at a time (though it could be extended to track multiple players in a cooperative
game).

This textual representation gives you the structure and details to create the class diagram
visually in your chosen tool. Remember to use the appropriate symbols for classes,
attributes, methods, and the different types of relationships (association in this case).

You might also like