Submission 2: Aggregation

Objective: Demonstrate aggregation by incorporating objects within other objects.

Instructions:

  1. Create an Item Class:

    • Attributes:

      • String name

      • int healthBoost

      • int attackBoost

    • Constructor: Initialize the item's properties.

  2. Modify the Player Class:

    • Add an attribute:

      • Item equippedItem

    • Methods:

      • void equipItem(Item item)

      • Update attack(Enemy enemy) to include attackBoost if an item is equipped.

  3. Modify the Enemy Class:

    • Enemies can drop items upon defeat.

    • Methods:

      • Item dropItem()

  4. Implement Item Usage in the Game Loop:

    • Allow the player to equip items dropped by enemies.

    • Update combat mechanics to reflect item boosts.

Deliverables:

  • Updated source code files.

  • Screenshot of the program running

COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark