Skip to content

Animal Selection Screen ‐ for Land, Water , Air Kingdoms

Shaivika Anand edited this page Sep 11, 2024 · 1 revision

The Animal Selection Screen - for Land, Water , Air Kingdoms class is a specialised screen in the game, designed to allow the user to select the respective animals based on the kingdoms. This class extends the AnimalSelectionScreen, inheriting common functionality while specifying the display components needed for air animal selections.

Class Structure

Package

package com.csse3200.game.screens;

Inheritance

public class AirAnimalSelectionScreen extends AnimalSelectionScreen

This screen is a subclass of the abstract AnimalSelectionScreen. It overrides the abstract method createDisplay to provide a display specific to air animals.

Constructor

public AirAnimalSelectionScreen(GdxGame game) {
    super(game);
}

The constructor accepts an instance of GdxGame and passes it to the superclass, initializing the screen for air animal selection.

Methods

createDisplay(Stage stage, Skin skin)

@Override
protected AnimalSelectionDisplay createDisplay(Stage stage, Skin skin) {
    return new Air/Land/Water-AnimalSelectionDisplay(stage, skin);
}

This method overrides the abstract createDisplay method from AnimalSelectionScreen to return an instance of AirAnimalSelectionDisplay, which defines the visual representation of the air animal selection.

Parameters:

stage: The stage on which the display will be drawn. skin : The UI skin used for styling the components.

Returns:

A new instance of Air/Land/Water-AnimalSelectionDisplay, which manages the selection of animals.

Clone this wiki locally