Skip to content

Minigames

Aryan Bhatia edited this page Oct 7, 2026 · 6 revisions

Introduction

Minigames are self-contained games reached from the Main Menu, separate from the main game area. Each minigame runs on its own screen with its own services, so it can be built and tested without touching the main game.

Available minigames:

  • Spin the Wheel - A wheel that is spun with random probability to receive an item/award
  • Cyclops Timing - A timing minigame that has a player moving between rocks to hide

Key Components

  • Minigame Type - Lists the available minigames and the names shown on the select menu: MinigameType.
  • Select Screen - The menu listing the available minigames: MinigameSelectScreen.
  • Select Display - Draws the minigame buttons onto the stage: MinigameSelectDisplay.
  • Select Actions - Switches to the chosen minigame's screen, or back to the Main Menu: MinigameSelectActions.
  • Minigame Screen - Handles the service setup, asset loading and teardown every minigame needs: extend MinigameScreen.

Adding a new minigame

  1. Add a value to MinigameType with its display name.
  2. Add a screen type to GdxGame.ScreenType and a case in GdxGame.newScreen().
  3. Add a case in MinigameSelectActions.onSelectMinigame() pointing at that screen type.
  4. Create a screen extending MinigameScreen under com.csse3200.game.screens.minigames.<yourgame>.
  5. Create the display, actions and any logic classes under com.csse3200.game.components.minigames.<yourgame>.
  6. Put assets under images/minigames/<yourgame>/ and list them in getTextures().

Example screen

public class SpinTheWheelScreen extends MinigameScreen {
  private static final String[] TEXTURES = {"images/minigames/spinthewheel/wheel-disc.png"};

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

  @Override
  protected String[] getTextures() {
    return TEXTURES;
  }

  @Override
  protected Entity createUI() {
    Stage stage = ServiceLocator.getRenderService().getStage();
    return new Entity()
        .addComponent(new SpinTheWheelDisplay(items))
        .addComponent(new InputDecorator(stage, 10))
        .addComponent(new SpinTheWheelActions(game));
  }
}

Testing

MinigameSelectActionsTest covers the select menu: selecting Spin the Wheel swaps to its screen, and the back button returns to the Main Menu.

Clone this wiki locally