-
Notifications
You must be signed in to change notification settings - Fork 9
Companion Modified Lab Window
Lab Window Class is specifically designed to be used within the game's laboratory or user interface.It displays a background texture representing the laboratory, setting the visual context for laboratory-related interactions.The lab window contains a set of user interface elements (buttons) that enable interactions. One of the central features of the LabWindow is the ability for players to select power-ups.
LabWindow(Texture background)
Creates an instance of LabWindow
with the specified background texture.
Parameters
-
background
(Texture): The background texture for the laboratory window.
MakeNewLaboratory()
Static factory method to create a new LabWindow
instance with a default laboratory background.
-
Returns:
-
LabWindow
: A newLabWindow
instance.
-
remove()
Call this method to exit the Laboratory. It also unregisters the input override component.
-
Returns:
-
boolean
:true
if the window was successfully removed; otherwise,false
.
-
The LabWindow utilises an InputOverrideComponent
to intercept and override user input while the lab window is active.
The LabWindow
class contains user interface elements for interacting with laboratory-related actions.
The laboratory window provides buttons for selecting different power-ups. These buttons allow the player to choose from various power-up options, each represented by an image and labeled with its name.
-
Power-Up Buttons:
- "Death"
- "Speed"
- "Health"
- "Invincibility"
- "2x Damage"
- "Extra Life"
- "Snap"
- "Double Cross"
When a button is clicked, the associated power-up is spawned in the game, and the laboratory window is closed.
Exit
Button
The "EXIT" button allows the player to exit the laboratory and return to the main game. Clicking this button closes the laboratory window.
Create a new Laboratory window with a custom background texture
Texture customBackground = new Texture("custom/lab_background.png");
LabWindow labWindow = new LabWindow(customBackground);
Add the laboratory window to the game stage
stage.addActor(labWindow);
To remove the laboratory window and exit the laboratory
labWindow.remove();
LabWindowTest is the test class for the modified LabWindow.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files