1.5. Dragon Sprint 3

  • Assignment: Dragon Sprint 3

  • Complexity: easy

  • Time: 13 min

1.5.1. Functional Requirements

  1. Dragon can move in any direction by specified value

  2. Assume left-top screen corner as an initial coordinates position:

    1. Going right add to x

    2. Going left subtract from x

    3. Going up subtract from y

    4. Going down add to y

1.5.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

1.5.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.5.4. Hints

  • It is not a mistake: 'left by 10 and right by 15'

  • End position should be: x=20, y=40

1.5.5. Solution

  • Note, that this will spoil your fun and learning

  • Solution