Space (part 6)

  • 14
  • Locked
But there's more. The BaseObject class needs more methods. For now, these will be empty draw() and move() methods. Subclasses will have to override them and implement the necessary functionality. Also add a die() method, which causes the object to die (isAlive = false).
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Skynet
Level 40 , USA
15 September 2021, 13:45
Formula for the intersects() method:
double distance = Math.hypot(this.getX() - o.getX(), this.getY() - o.getY());
return distance < Math.max(this.getRadius(), o.getRadius());
Vishnu
Level 25 , Richardson, United States
19 December 2019, 13:15
Any suggestions on last condition ?