1.6. Dragon Sprint 4

  • Assignment: Dragon Sprint 4

  • Complexity: easy

  • Time: 21 min

1.6.1. Functional Requirements

  1. Dragon can make random damage in range from 5 to 20

  2. Dragon can take damage

  3. When dragon is dead:

    1. Display Dragon NAME is dead, where NAME is dragon's name

    2. Display how much gold dropped (random int from 1 to 100)

1.6.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.6.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.6.4. Hints

  • from random import randint

  • randint(a, b) - random integer between a and b (inclusive!)

1.6.5. Solution

  • Note, that this will spoil your fun and learning

  • Solution