Skip to content

Soldier units

yashvardhanbatra edited this page Oct 17, 2022 · 14 revisions

Overview

Soldier units are the main defender of Atlantis City. Their goal is to defeat enemies while also defending the city at the same time. Every soldier unit has its own unique ability, stats and costs. Players are encouraged to utilize their unique stats and aim for victory.

Soldier types

Units information for soldiers can be seen as follows:

  • Archer: The main range unit with low defense and hp, but high attack
  • Swordsman: The main frontline with high attack, but low defense
  • Spearman: The basic unit with decent stats
  • Hoplite: The main frontline with high defense, but low attack

Functionality

Soldier Factory

Creating a Base Soldier

InputComponent inputComponent = ServiceLocator.getInputService().getInputFactory().createForFriendlyUnit();
AITaskComponent aiComponent = new AITaskComponent().addTask(new SoldierIdleTask());
Entity soldier =
                new Entity()
                        .addComponent(new PhysicsComponent())
                        .addComponent(new PhysicsMovementComponent())
                        .addComponent(new ColliderComponent())
                        .addComponent(new HitboxComponent().setLayer(PhysicsLayer.SOLDIER))
                        .addComponent(new FriendlyComponent())
                        .addComponent(new SelectableComponent())
                        .addComponent(new HealthBarComponent(EntityType.FRIENDLY))
                        .addComponent(aiComponent)
                        .addComponent(inputComponent)
                        .addComponent(new TouchAttackComponent(PhysicsLayer.NPC));

SoldierFactory Sequence Diagram

Screen Shot 2022-10-16 at 5 00 17 pm

Fighting Movement Task

Description

This implements a fighting task for a Soldier. A Soldier may chase down an enemy or move to a specified target until they arrive. In the game, a user selects a target enemy for the soldier and the soldier will follow the enemy. But if what the user selects is not an enemy, it will move to the clicked location.

FightingMovementTask Sequence Diagram

Screen Shot 2022-10-16 at 4 53 39 pm

Soldier Class Diagram

The following is a class diagram of all the classes in the Soldier:

ArcherAnimationController

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