Skip to content

PlanetTravel Class

24msingh24 edited this page Oct 18, 2023 · 5 revisions

PlanetTravel Class

Description

The PlanetTravel class is responsible for handling the travel between planets in a game and managing the number of remaining planets. It provides methods for transitioning between planets and updating game state information.

Class Structure

  • Attributes

    • game (GdxGame): The game instance associated with the planet travel.
  • Methods

    • PlanetTravel(game: GdxGame): Constructor to initialize the PlanetTravel instance.
    • beginFullTravel(): Initiates a full transition to the next planet, displaying intermediate gameplay.
    • beginInstantTravel(): Travels instantly from the current planet to the next one.
    • returnToCurrent(): Returns to the currently loaded planet.
    • moveToNextPlanet(planet: Object): Moves to the next planet and spawns the minigame screen.
    • returnCurrent(): Returns the current planet where the player is located.

Usage

  1. Initialization: To create a PlanetTravel instance, you need to provide a GdxGame instance.

    PlanetTravel planetTravel = new PlanetTravel(game);
Screenshot 2023-10-19 at 2 25 20 AM
Clone this wiki locally