Skip to content

Random Weather Events

quocdat402 edited this page Sep 12, 2022 · 14 revisions

Overview

Weather icon will be displayed randomly at the start of the game and can randomly change to a different icon after x minutes, weather icon should not be appeared two times in a row. Along with the changing of the weather icon, the weather visual filter will also be applied to change the look of the game. The movement of the unit will also be affected (ie. slow down) depending on the weather effect.

Displaying the weather icon and timer

Usage

Setting the layout for weather icon and timer, to adjust the icon and timer bigger or smaller or change the position of it, change value in setSize() and setPosition() to desired choice. The default for now is on the top middle.

  public void layout() {
        public void layout() {
        //  Layout for weatherFilter
        weatherFilter.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        weatherFilter.setPosition(0,0);

        //  Layout for weatherImage
        weatherImage.setSize(75f, 75f);
        weatherImage.setPosition(Gdx.graphics.getWidth()/2f-weatherImage.getWidth()/2f, Gdx.graphics.getHeight()-85f);

        //  Layout for timer
        this.timerLabel.setAlignment(Align.left);
        this.timerLabel.setWrap(true);
        this.timerLabel.setSize(3f,3f);
        this.timerLabel.setPosition(Gdx.graphics.getWidth()/2f + weatherImage.getWidth()/2f + 15f, Gdx.graphics.getHeight()-50f);
    }

Code for all the implementation can found here

WeatherIcon

WeatherIconDisplay

UML model

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