Project Review: Mobile 2D Adventure
Wrapping Up My Latest Prototype
The main features are complete for the prototype version of my 2D adventure game for mobile platforms. Here are the highlights:
Tilemap Environment With Parallax
I created tilemaps from sprite assets and set each grid on its own z-axis to create a parallax effect. I also added the Unity 2D Extras package and used it to create animated tiles for water and a prefab brush to place collectible gems in the scene.
Rigidbody Physics Character Controller
I scripted and animated a character controller in C# using Unity’s Rigidbody physics and the new Input System package.
Enemy Abstract Class and Subclasses
I created an Enemy template class to hold most of the functionality of my enemies, and subclasses to differentiate each enemy type. The basic AI has two states: patrol and combat. I have plans for an Alert state, but it’s not necessary for this prototype.
Damage Interface And Attack Script
I implemented a universal attack system with an Interface for taking damage. The attack script is attached to any object with a collider that is meant to cause damage, such as the player’s weapon collider.
Loot and Shop System
I added the ability for enemies to drop loot (seen above) and a shop for the player to spend their loot. The shop features a button that allows the player to earn some more loot by viewing an ad.
On Screen Virtual Controls
I added on-screen touch controls seamlessly, by adding the OnScreenStick and OnScreenButton class components to my UI images.
Wrapping Up
That’s it! This one only took me a week to put together. Likely it will take a few weeks to actually turn these systems into an enjoyable game experience, but the features all work, so this prototype is officially complete.
Tomorrow I’ll start work on a 3D zombie shooter game, which will be the focus of the next several articles. See you then!