-
Notifications
You must be signed in to change notification settings - Fork 9
PlanetTravel Class
PlanetTravel
is a class responsible for managing travel between planet and storing information about the current game state. It is part of the com.csse3200.game.services
package and is used in the GdxGame
project.
The PlanetTravel
class is used in the context of a game to handle transitions between planets and to provide various travel-related functionalities. It is responsible for initiating gameplay transitions, updating the current planet, and managing game screens.
- Constructor to set the current game state for use.
-
game
: An instance ofGdxGame
, which represents the current game.
- Initiates a transition to the next planet with intermediate gameplay in between.
- Travels from the current planet to the next planet instantly.
- Travels back to the currently loaded planet, resetting player and companion health.
- Moves to the next planet and spawns the minigame screen.
-
planet
: The destination planet.
- Returns the current planet where the player is located.
To use the PlanetTravel
class, you should create an instance of it and call its methods according to your game's logic. The class provides methods for transitioning between planets and updating the game state.
// Example of using PlanetTravel
GdxGame game = new GdxGame(); // Replace with your actual game initialization
PlanetTravel planetTravel = new PlanetTravel(game);
// Initiating a full travel to the next planet
planetTravel.beginFullTravel();
// Traveling instantly to the next planet
planetTravel.beginInstantTravel();
// Returning to the currently loaded planet
planetTravel.returnToCurrent();
// Moving to the next planet and spawning the minigame screen
Object nextPlanet = "Mars"; // Replace with the actual planet object
planetTravel.moveToNextPlanet(nextPlanet);
// Retrieving the current planet
Object currentPlanet = planetTravel.returnCurrent();
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files