Skip to content

Final Boss Animation

Annabel-Kennedy edited this page Oct 4, 2022 · 8 revisions

Navigation / Quick Links

Implementation

Animation was implemented using the information found in the base game engine wiki. Animations for the final boss are controlled using the BossAnimationController, which inherits from Component and implements an animation depending on the direction the boss is facing. Because animations were implemented for side-on views only, and it can be safely assumed the boss will always travel towards the crystal, implementation of this controller was very straightforward.

On creation, BossAnimationController takes an Entity as its target. The boss will be animated facing left or right, depending on which direction is closer to facing the target. The direction vector of movement towards the entity is found (using getPosition() for both entities), then converted to a unit vector. The x and y components of that unit vector are then added, and the boss is animated facing right if the result > 0, and left if the result is < 0. Diagram below demonstrates how this works (pink is negative, green is positive) image

In future, the controller could be adjusted to respond to events triggered by the movementTasks, however this logic was appraised to be unnecessarily complicated for the desired functionality. It could also be possible in future work to set it up so that the animation occurs only when the boss is attacking (see ContinuousAttackComponent here)

Table of Contents

Home

How to Play

Introduction

Game Features

Main Character

Enemies
The Final Boss

Landscape Objects

Shop
Inventory
Achievements
Camera

Crystal

Infrastructure

Audio

User Interfaces Across All Pages
Juicy UI
User Interfaces Buildings
Guidebook
[Resource Management](Resource-Management)
Map
Day and Night Cycle
Unified Grid System (UGS)
Polishing

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