A mini game featuring various visual effects and simulations, supporting singleplayer and local multiplayer

Overview

This is a mini-game developed in collaboration with Jiajun Tang. The game has a land-battle and a naval-battle component.

Gameplay

Player 1 controls the bomber to destroy the convoy/battleship (“w” and “s” for turning up and down; “SPACE” for dropping bombs).
In the land battle, player 2 controls the anti-air gun to shoot down the bomber (“RIGHT” and “LEFT” to rotate clockwise and counter-clockwise, and “ENTER” to fire).
In the naval battle the battleship will automatically shoot at the bomber.
As the bomber takes more damage it becomes slower and harder to control. The source code and demo can be download here.

Particle Systems

The fire, spark, smoke, and splash effects are achieved using custom particle systems. They all share a same particle system class. The only differences are the color and the way they update.

Rigid Body Dynamics

The animation of the destroyed turret follows rigid body dynamics. The collider of the turrets is simplified as rods.

Fluid Simulation

The sea waves are simulated with shallow water equations. Explosion will cause the height field in the corresponding slot to increase, and then the extra height will propagate to neighboring slots.

Anticipatory Collision Detection

The auto-fire in the game predict the trajectory of the plane based on its current velocity and calculate the correct firing angle to guarantee a hit. Given the very limited reaction time, random perturbation to the firing angle is applied to reduce the difficulty.

Statement: If no specific statement in the content, the copyright belongs to Yuxuan Huang . Reprint please indicate the link of this article.

(The content is authorized with CC BY-NC-SA 4.0 protocol)

Title:《 Mini War Game 》

Link:https://yuxuan-huang97.github.io/game/war-game.html

The last update of this article was days ago, so it may be outdated!