Create an animated GUI application that does the following:

  • Create several planets, around 10 or so.
    • each planet has a population of a fleet of spaceships.
    • each planet has a size and location.
    • each planet generates new ships based on its size.
    • each planet has a color based on who controls it.
  • A player begins with a home planet and an initial population.
  • When a player clicks on a planet they own, they can select the percentage of the population that they wish to use to invade another planet.
  • Once a population has been selected, the user clicks on a planet to invade.
  • The invading population fights the population on the planet being invaded. The fights should destroy each other in a near one to one ratio, with some randomness thrown in.
  • If the invading fleet was significant enough to overtake the planet population, then that world is conquered and the planet is now under the player’s control. If the invading population was insufficient, then the planet is still under its own control, but it will have suffered some losses from the fight.
  • Each planet regenerates its population relative to its size. The larger the planet, the faster it regenerates. Regenerate this amount per game tick.
  • When all of the planets are under the player’s control, then they have won.

Application:

  • Use a new thread for each of the planets so that they can all regenerate independently.
  • Use a separate thread for moving the fleet.
  • Animate the movement of the fleet from one planet to the other.
  • Use a * to move the ships, they should not fly through planets but move around them.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.