Space Invaders (Part 24/34)

  • 3
  • Locked
When you release the left key or the right key, the ship does not stop moving until it hits the edge of the playing field. Let's fix that. We'll override the Game class's onKeyReleased() method. This method is called when keys are released. If the player's ship is moving, the onKeyReleased(Key) met
You can't complete this task, because you're not signed in.
Comments (4)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Agent Smith
Level 38
9 October 2020, 10:55
1. The PlayerShip class must have a public getDirection() getter that returns the value of the direction field. Seems pretty strange. I think Ship class should have this getter method, since direction is declared there. Also, it would be useful to have in the previous task, where we have to get Ship direction value in PlayerShip method move(), but it is a private field...
Branka
Level 41 , Belgrade, Serbia
22 June 2020, 14:14
In the requirements: not the onKeyPress(Key) method should be written, but onKeyReleased(Key).
Roman
Level 41
26 June 2020, 05:52
Thanks, we'll fix it
Pack Mtd
Level 1 , Urbana, United States
1 April 2020, 16:39
PACK SWEET