Mini‐Game Integration - UQcsse3200/2024-studio-2 GitHub Wiki
Description
This wiki page will breifly discuss the mini-game integration into the main game.
Each mini-game is associated with an NPC Character. Snake mini-game is associated with the snake npc, Birdie Dash is associated with the magpie npc and the underwater maze is associated with the clown fish npc. Each NPC has it's own story of why it wants you to complete a mini-game. The snake NPC is very hungry and wants you to collect some apples for it to eat. Magpies notoriously want shiny things. This magpie wants you to collect coins. The clown fish was looking after some fish eggs and a tide came through and the fish got lost. It is getting dark so you must help the fish by collecting all the fish eggs in the dark.
A play game button has been implemented into the DialogueBox Class. This button is visible when a dialogue message contains either a /ms, /mb or /mu at the beginning of the string.
The play game button then boots up the associated mini-game screen. Note that we have used preserving screens so when the player returns to the main game it is as if nothing has changed. To be able to boot up the screen, access to the gdxgame instance is needed. Passing it through the various classas was inpractical. So, a singleton was implemented in the ServiceLocator.
In dialogue box:
In GdxGame: