Skip to content

Level System Overview

Michael Kidd edited this page Sep 3, 2024 · 25 revisions

Table of Contents

Coding Overview

NOTE: The spawning stuff is temporary for now, until proper customer spawning code is provided

So we got LevelService, which has some private variables and public methods

Below is the constructor for the LevelService, which initialise some private variables, and most importantly registers some listeners.

image

The levelControl() method called by the startLevel event currently takes one parameter. All it does for now is limit the number of customers that spawn.

image

This is in the MainGameScreen class, at the bottom of the constructor. The first two statements become more relevant in later photos.

image

This is from the LevelComponent class. The event startSpawning, if you remember, is triggered in LevelService by levelControl()

image

This is what the event startSpawning calls. This method basically just ensures that all private variables are reset, but most importantly, enabled spawning through the toggleNowSpawning() method.

image

Speaking of, here is the toggleNowSpawning() method

image

Now the reason why I use a Component in the first place is because the Entity class has a very nice method which is create for asynchronous code which can be called constantly (I didn't know about scheduledEvents)

image

And finally, in the create() method in ForestGameArea, the event spawnCustomer is registered (the event triggered during the hijacked update() method).

image

And this is what the spawnCustomer() method looks like, again, in the ForestGameArea class (it was conveniently already here)

image

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