Skip to content
yashvardhanbatra edited this page Oct 16, 2022 · 20 revisions

Archer

image

General Info

The archer is a long-ranged unit with high attack points but is very fragile to enemies' attacks. This unit is best suited for the backline so that they can attack the opposing units, or otherwise, they will get eliminated very quickly.

Unit stats (Pending)

Made in: Building
Costs 15 wood
Troops: 4
Attack: 5
Defence: 1
Health: 20
Movement speed: 1

Sprites Design

The following archer designs were initially designed to match the top-down view map but were then changed into the designs in the next section.

image

However, as there were some changes to the map and building designs, huge changes, such as isometric perspective and design style, were made in order to match the design with other features.

The following images are the updated sprites sheets for the archer unit:

  • Walking

Archer_Sprite_Sheet Archer_Reversed_Sprite_Sheet Archer_Back_Reversed_Sprite_Sheet Archer_Back_Sprite_Sheet

  • Attacking

Archer_Attack_Reverse_Sprite_Sheet Archer_Attack_Sprite_Sheet Archer_Back_Attack_Reverse_Sprite_Sheet Archer_Back_Attack_Sprite_Sheet

The following sprite sheet includes all the animation for every direction, including when the unit is being highlighted:

archer_sprite_sheet

Archer Animation

For the fourth sprint, team 8 worked on creating an animation for the archer. The ArcherFactory creates a static entity archer which is capable of shooting arrows at a target. A sprite for the static archer was created using previously created archer sprites. Since an archer is a type of friendly unit which is used in long - range combat situations, it was created to be a static entity.

image

The following code implements the use of the ArcherFactory:

   public static Entity createArcher(Entity target, GameArea gameArea) {
        Entity archer1 = new Entity()
                .addComponent(new PhysicsComponent())
                .addComponent(new PhysicsMovementComponent())
                .addComponent(new ColliderComponent())
                .addComponent(new HitboxComponent().setLayer(PhysicsLayer.SOLDIER))
                .addComponent(new FriendlyComponent())
                .addComponent(new HealthBarComponent(EntityType.FRIENDLY));

        AITaskComponent aiComponent = new AITaskComponent()
                .addTask(new rangedAttackTask(target, 4, 10, 2000f));

        archer1.addComponent(new TextureRenderComponent("images/archerstatic.png"))
                .addComponent(new CombatStatsComponent(stats.health, stats.baseAttack, stats.baseDefence))
                .addComponent(aiComponent)
                .addComponent(new AttackListener(target, gameArea));
        archer1.scaleHeight(0.8f);
        archer1.scaleWidth(0.5f);
        return archer1;
    }

The archer entity uses the rangedAttackTask to animate the arrow, which was designed specifically for the archer. The arrow is shown as below.

image (Image Credits: Lorenzo)

When spawned, the visual appreance of the archer shooting arrows at the target is observed.

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