Skip to content

Game Screens

Sarahkhalek edited this page Sep 11, 2024 · 21 revisions

Introduction

The game contains several screen which which each implement libgdx's ScreenAdapter interface. Screen are responsible for initiating important game services, loading screen resources, drawing the background and UI, rendering the entities, handling input, etc.

Only one screen is shown at a time and GDXGame.java contains functionality for transitioning between screens. Screen transitions are triggered by the current screen.

Within the base game, there are 3 screens: Main Menu Screen, Main Game Screen, and Settings Screen. The Main Menu Screen is the starting screen.

Screenshot 2024-09-11 at 12 01 19 am Screenshot 2024-09-11 at 12 09 45 am Screenshot 2024-09-11 at 12 10 12 am

Screens can also be split into different Game Areas which can be used to create different levels and areas. Read more here!

Development of game title screen logo

Logo was designed and developed using canva. We decided to go for red theme since we thought it aligned with the title 'beastly'. We browsed through canva and tried different designs until we found we liked and decided on keeping it.

Beastly

Main screen layout inspiration

  • Large game logo covering half of screen
  • Horizontal row of buttons at bottom of screen
  • Large visible buttons

Screenshot 2024-09-11 at 12 32 29 am

Screenshot taken from Stardew Valley

Changing of button style upon hover

Button changes to a red color when hovered over

Screenshot 2024-09-11 at 12 36 07 am

Spawning aninamls/food items in the background

The images of food and customers have been taken and generated at random. They spin and move around the screen at random positions. This is achieved by using the Image class to render the images and adding actions to it. It enables us to rotate specified degrees and also to move it from one point to another. The random position and movement is achieved by using a random generating function. For despawning of the objects, we setup a timer that removes any object that has completed its movement.

Screenshot of main menu

Usage

Add a new screen

Create a new screen class, e.g. NewScreen.

  public class NewScreen extends ScreenAdapter {
    ...
  }

Then, register the new screen in GDXGame.java by adding NEW_SCREEN to ScreenType and modifying newScreen:

  private Screen newScreen(ScreenType screenType) {
    switch (screenType) {
      ...
      case NEW_SCREEN:
        return new NewScreen(this);
      ...
    }
  }

  public enum ScreenType {
    MAIN_MENU, MAIN_GAME, SETTINGS, NEW_SCREEN
  }

Switch screen

  private void switchScreen(GdxGame game, ScreenType screenType) {
    game.setScreen(screenType);
  }

UML Diagram

Below is a UML diagram for MainMenuDisplay. It oulines the functions being used along with the classes it uses. This provides a detailled summary of how we were able to create the main menu screen specifically the spawning of the items in the background. uml diagram for main menu display

Table of Contents

Home

Team Design Document

Game Features

Inventory System
Scoring System
Food Recipes
Level System
Player Actions
Ordering System
Stations
Items
Map Design
Customers
Pause Menu
Upgrades
End of Day Display
Day Night Cycle
Moral System
Debug Terminal
Game Interactions Tutorial
Backstory Cutscenes

Game

Getting Started

Entities and Components

World Backstory

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Map Design

Test Plans

Sensor Component

Customer Sensor Component

Interaction Component

Inventory Component

Inventory Display

Station Meal Component

Station Progress Display

Keyboard Input Component

Fire Extinguisher Handler Component

Score System

HoverBox Component

MainGameActions Create Docket Triggers

End Day Display Component

Cutscene Area

Docket

Docket Line Display

Docket Meal Display

Main Game Order Button Display

Order Actions

Recipe

Ticket Details Component

BackstoryCutscene Test Plan

BackstoryCutsceneDisplay Test Plan

Test Plan for Tutorial

Keybinds

Keybinds Test Plan

Test Plan for MainGameOrderTicketDisplay

Test Plan for MainGameOrderBtnDisplay

Test Plan for Docket

Test Plan for DocketLineDisplay

Test Plan for OrderActions

Ticket Details

Test plan for RandomComboService

Test plan for LoanUpgrade

Test plan for UpgradesDisplay

Test plan for RageUpgrade

Test plan for SpeedBoostUpgrade

Test plan for DancePartyUpgrade

Test plan for ExtortionUpgrade

Troubleshooting

MacOS Setup Guide

Clone this wiki locally