Skip to content

Shop UI Functionality & Display

kaitlyn-lake edited this page Oct 17, 2022 · 4 revisions

Overview

The shop UI was created with the purpose of adding game play functionality akin to an RTS game. When the library, blacksmith or barracks are clicked in the game, the player has the option of trading stone, wood and metal resources for options in the shop. The shop UI options and prices for each building:

Library

  • 30 Stone -> Upgrade woods
  • 30 Wood -> Level up building

Blacksmith

  • 30 Metal -> Upgrade units
  • 30 Wood -> Level up building

Barracks

  • 30 Metal -> Spawn units
  • 30 Wood -> Level up building

Display

The shop UI can be found when a building is selected, and appears on the building data component at the bottom left hand corner of the screen. An example for the barracks shop:

Figure 1

image

ShopUIFunctionalityComponent class diagram

image

ShopUIFunctionalityComponent.java test plan

The ShopUIFunctionalityComponent is tested with ShopUIFunctionalityComponentTest.java. It contains the following tests:

spendResourcesTest() -> tests whether the component can correctly tell whether the player has enough resources to buy an item at the shop.

onUnitUpgradeTest() -> tests whether the stats of all unit entities increase when the player selects Unit upgrade from the shop

onWallUpgradeTest() -> tests whether the stats of all wall entities increase when the player selects Wall upgrade from the shop

The following methods were unable to be effectively tested due to being primarily visual or UI components:

removeButton() ->

This method is tested with the following visual inspection:

  • When the shop exit button is clicked, it removes both the building data component (if displayer) and shop interface.

spawnUnits() ->

This method is tested with the following visual inspection:

  • When Spawn unit is selected from baracks, an archer, spearman and hoplite are spawned in the centre of the city.

BuildingUIDataComponent.java test plan

The development done on BuildingUIDataComponent was tested primarily visually. The following criteria must be met for it to be working satisfactorily:

  • Each UI component must align as seen in the shop UI in Figure 1
  • When the shop exit button is clicked, both the building data component and shop interface must disappear. If the building has already been clicked away from, then pressing the exit button must remove the shop UI
  • When different shop buildings are clicked, the shop UI for the new building must override the old.
  • The correct cost values and button labels must be displayed for each building type as outlined in Overview.

Bugs & issues

There was a small flaw in the interaction of the shop UI. When the player selects a valid building the shop UI draws on the building data component, when a player clicks away from the building the data component disappears but the shop UI remains. This flaw was not corrected due to the time constraints of Sprint 4, and the amount of time required to fix this flaw would be too great compared to the game experienced it would provide. It was decided time would be better spent fixing real game play bugs.

Table of Contents

Home

Game

Game Home

Design Influences

Gameplay Features

Style

Story

Friendly Units
Map
City
Buildings
Unit Selections

Spell

Game User Testing: Theme of Unit Selection & Spell System

UI User Testing

Tutorial

Resource Stats Display

Loading Screen Bar

Health Bars
In Game menu
  • Feature
  • User Testing:In Game Menu

Landscape Tile Design

Landscape Tile Design Feedback

Weather Design

Weather Design Feedback

Camera Movement

Enemy design

Enemy Units

Enemy AI

How Animation Works

Map Flooding

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally