Skip to content

Effect Of Weather On The Unit Movement

Fauzan "Corfliss" Hanandito edited this page Sep 11, 2022 · 2 revisions

Overview

Changing the movement speed for the unit according to the weather that is represent in Weather Effect Visual Representation.

Usage

Edit these variable to change the movement speed of the unit arcoding to the weather. It is exists in WeatherIcon. The value below are exaggerated at the moment.

private final float[] movementSpeedFactor = {
            1.5f,
            0.5f,
            0.4f,
            2f,
            0.6f
    };

There are some slight addition on the PhysicsMovementComponent about the change of the velocity of the movement according to the weather. It will update the value of it with the multiplication from the movementSpeedFactor above.

  public void changeSpeed(float factor) {
    float newSpeed = this.speed * factor;
    this.vel = new Vector2(newSpeed, newSpeed);
  }

You can try to access the code using the listener function on your code. For now, the trigger to change the movement speed exists on WeatherIconDisplay on Update() function.

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