Skip to content

Obstacles

ShiyanSu edited this page Aug 30, 2021 · 27 revisions

Purpose

To make the game become more challenging and immerse the player into the atmosphere of the game, we aim to implement the obstacle feature for the game. Initially, once the player starts the game, several types of obstacles will appear on the game map. In addition, different types of obstacles will cause different amounts of damage to the game character, and also they will have different movements and functionalities. In order to survive the game, the player must try to avoid as many obstacles as possible.

Types of obstacles

Static obstacles:

  • Asteroid: A type of static obstacle that appears once the game starts and the position of each asteroid remains stable within the game. It does not have any damage to the player but the player cannot pass it directly.
  • Asteroid fire: A type of static obstacle that appears once the game starts and the position of each asteroid fire remains stable within the game. For those asteroid fire obstacles on the map, if the player touches them (inside of the attack range of the asteroid fire), the player's health will be reduced by 10.
  • Platform: A type of static obstacle that appears once the game starts and the position of each platform remains stable within the game. For those platform obstacles on the map, the player could jump onto them and move freely. This obstacle would not cause any damage to the player. Therefore, the player could use them effectively to avoid other types of obstacles.
  • Rocks: When the game starts, rocks are randomly distributed on the horizontal surface, and the types of rocks will also change randomly. Rocks will block the player's walking, but the player can jump over the rocks, and the rocks cannot cause damage.

Dynamic obstacles:

  • UFO: A type of dynamic obstacle that randomly appears in the upper area of the map When the game is running, and randomly moves in different directions during the game. When the player collides with the UFO, the player will lose a certain amount of blood that is 25.
  • Robot: A type of dynamic obstacle that appears once the game starts and the position of the robot should be constantly changing. During the game, the robot will move left and right at a constant speed. For the robot on the map, if the player collides with it(inside of the attack range of the robot), the player's health will be reduced by 20.

Implementation

Key Components

  • obstacle.json This JSON file includes the initial properties (health, baseAttack) of all the aggressive obstacles.
  • ObstacleConfig Defines all Obstacle configs to be loaded by the Obstacle Factory.
  • AsteroidConfig RobotConfig UfoConfig Defines the properties stored in obstacle config files to be loaded by the Obstacle Factory.
  • ObstacleFactory Factory to create obstacle entities, all types of obstacles are created and implemented here.

Table of Contents

Home

Introduction

Main Menu

Main Game Screen

Gameplay

Player Movement

Character Animations

Enemy Monster Design and Animations

Game basic functionalities

User Testing

GitHub Wiki Tutorial

Game Engine

Getting Started

Documentation

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