Animal Roulette Screen - UQcsse3200/2024-studio-2 GitHub Wiki

Overview

The Animal Roulette Screen is a central interface in the game that allows players to select animals from different kingdoms. This screen features a roulette-style selection mechanism, enhancing the user experience and making animal selection more engaging.

Purpose

  • Animal Selection: Players can choose from three different animals representing land, air, and water kingdoms.
  • User Interface: The screen utilizes a dynamic UI that adapts based on player interactions and selections.
  • Transition Management: Manages transitions between the animal selection screen and other game screens.

Structure

Constructor

The constructor initializes the screen and sets up essential components, including the Stage, Skin, and associated action handlers.

public AnimalRouletteScreen(GdxGame game) {
    this.game = game;
    stage = new Stage(new ScreenViewport());
    Gdx.input.setInputProcessor(stage);
    Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json"));
    PopUpHelper dialogHelper = new PopUpHelper(skin, stage);
    
    display = createDisplay(stage, skin);
    actions = new AnimalRouletteActions(display, dialogHelper, game);
    
    createUI(skin);
    actions.resetSelection();
}

Methods

  • render(float delta): Renders the stage and updates UI elements based on user interaction.
  • resize(int width, int height): Updates the UI layout dynamically when the screen is resized.
  • dispose(): Cleans up resources used by the stage.

Navigation

From this wiki, you can explore the individual animal wikis for more detailed information about each kingdom: