1.10. Dragon Sprint 8

  • Assignment: Dragon Sprint 8

  • Complexity: hard

  • Time: 34 min

1.10.1. Functional Requirements

  1. The game includes equipment:

    1. armor and shield protects against impacts by reducing the amount damage by defense value,

    2. the sword increases the amount of damage dealt,

  2. Each item has its own name, type and modifier:

    1. armor (additional defense points, e.g. +10%)

    2. shield (additional defense points, e.g. +5%)

    3. sword (additional attack points, e.g. +5%)

  3. The hero can equip equipment:

    1. you can only have one armor and one helmet at a time

    2. a hero of any class can only use one sword and shield

    3. warriors can use two swords, but not a shield

1.10.2. Use Case

  1. Create dragon with name "Wawelski"

  2. Set Dragon's initial position to x=50, y=100

  3. Set new position to x=10, y=20

  4. Get current position

  5. Move dragon left by 10 and down by 20

  6. Move dragon left by 10 and right by 15

  7. Move dragon right by 15 and up by 5

  8. Move dragon down by 5

  9. Dragon makes damage (random 5-20)

  10. Dragon takes 10 damage

  11. Dragon takes 20 damage

  12. Dragon takes 30 damage

  13. Dragon takes 40 damage

  14. Dragon takes 50 damage

1.10.3. Non-Functional Requirements

  1. Commit and push the current state of the repository

  2. Modify the game code from the previous version of the task

  3. Save the code to solve the task in the dragon directory

  4. When finished, add all files from dragon to the repository

  5. Commit and push changes to a central repository (Github)

1.10.4. Solution

  • Note, that this will spoil your fun and learning

  • Solution