Repository navigation
Minigames
Aryan Bhatia edited this page Oct 7, 2026
·
6 revisions
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
-
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.
- Add a value to
MinigameTypewith its display name. - Add a screen type to
GdxGame.ScreenTypeand a case inGdxGame.newScreen(). - Add a case in
MinigameSelectActions.onSelectMinigame()pointing at that screen type. - Create a screen extending
MinigameScreenundercom.csse3200.game.screens.minigames.<yourgame>. - Create the display, actions and any logic classes under
com.csse3200.game.components.minigames.<yourgame>. - Put assets under
images/minigames/<yourgame>/and list them ingetTextures().
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));
}
}MinigameSelectActionsTest covers the select menu: selecting Spin the Wheel swaps to its screen,
and the back button returns to the Main Menu.
Entities and Components
Input Handling
Arrow Selection Wheel Arrow Selection Wheel — Sprint 3