Skip to content

Player Interaction and Movement Visuals

amacn13 edited this page Sep 11, 2024 · 25 revisions

This wiki will outline the design decisions involved with the implementation of the new sprite, the visualisation of the player movement and interactions.

Redesigning the player model

Overview

  • Redesign the current sprite
  • Choosing what size to render the sprite as

Image of the new sprite

image

The height of the sprite was chosen based on the height of the benches. We wanted the height of the sprite to be just above the benches such that when the sprite walks behind the benches you can still see him.

Visualisation of player movement

Overview

  • Redraw the sprite in all adjacent motion (in the sense of a 3x3 area)
  • The sprite renders moving up, down, left, right, and diagonally

What the uploaded image of movement looks like image

The new sprite model will use an atlas style function to run through the image and identify each 32x32 sprite within the image.

Visualisation of player item holding

Overview

  • Drawing the sprite holding each item in a certain manner
  • The decisions made to draw the sprite holding it in this manner
  • What items will be rendered on the player
  • How the code was implemented to update the sprite on which item to hold

Option 1

Option 1 shows the sprite holding spherical ingredients above their head.

image

Option 2

Option 2 shows the sprite holding cylindrical ingredients over one shoulder / held from one arm. image

Overview of options

Since different ingredients are better to be portrayed in separate ways (i.e. sliced chocolate on top of the sprite's head instead of in their arms) a combination of both options were used to show the sprite holding different kinds of ingredients.

An example of option 1 being used on spherical ingredients (strawberries) image

An example of option 2 being used on cylindrical ingredients (fish) image

List of items that will be drawn for the sprite to hold:

Ingredients:

  • Raw acai
  • Chopped acai
  • Raw beef
  • Cooked beef
  • Burnt beef
  • Raw banana
  • Chopped banana
  • Raw lettuce
  • Chopped lettuce
  • Raw cucumber
  • Chopped cucumber
  • Raw tomato
  • Chopped tomato
  • Raw strawberry
  • Chopped strawberry
  • Raw chocolate
  • Chopped chocolate
  • Raw fish
  • Cooked fish

Meals:

  • Acai Bowl
  • Banana Split
  • Fruit Salad
  • Salad
  • Steak

Other Items:

  • Fire Extinguisher
  • Plates (Empty)

How it was implemented

The change of sprite visualisation was handled through switch cases that check what item is in the first slot of the player's inventory and identifying the item type of it. Once updateLabel has correctly identified the item it updates the sprite on which item to hold.

Testing

To confirm that the correct animation is used for each movement, the verify function is used to ensure the correct animation is starting. e.g.

    pac.create();

    pac.animateLeft();
    verify(pac).animateLeft();
    verify(animator).startAnimation("Character_Left");

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