
Learn to build a full 2d rts mobile game in Unity from scratch, covering tilemaps, a-star pathfinding, ai, combat, resources, and publishing steps for iOS and Android.
Learn practical troubleshooting strategies for game coding across languages, using code samples, copy-and-paste exploration, and ChatGPT explanations. Access course resources, GitHub commits, and how to share zipped projects for help.
Set up a new Unity 2D project named HVO, install Unity Hub with an LTS version, and configure Visual Studio Code with Unity and C# tools.
Import itch.io assets, slice 64×64 tiles in the editor, set pixels per unit to 64 and point filter, then build a terrain tile palette and paint walkable tiles.
Learn to layer tile maps in unity 2d by creating walkable, under terrain, and elevation maps, adjusting sorting orders, and blending terrain with rocks and grass for richer battle maps.
Learn to create and apply animated tiles in Unity 2D by slicing sprites, configuring animated tile assets, and synchronizing foam and water tiles on a terrain tilemap.
Discover creating animated rocks and water tiles, slicing sprites, and painting walkable tilemaps; build edges, under terrain, and water layers while adjusting the camera for map view.
Extract the blue bone warrior sprites from the knight sheet, slice into six 192×192 frames, and create builder idle and warrior idle animations with animator controllers for preview in Unity.
Learn to implement a base unit class and humanoid units (builder and warrior) with ai pawn pathfinding to move toward a destination, using speed and normalization in Unity.
Create and organize builder and warrior animations in Unity by making new clips (idle, run, build, chop, collect, attack) and setting frame ranges, then connect them in the animator.
Implement a moving check by tracking velocity as the difference between current and last positions, scaled by delta time, and expose a public isMoving flag to reflect movement.
Apply speed to the animator by creating a speed parameter, connecting idle and run transitions for builder and warrior, and unchecking has exit time for immediate transitions.
Select a unit, then click the map to move it, as a singleton game manager coordinates clicks, unit selection, movement, and win/lose state.
Build a reusable singleton manager base class for Unity, enabling lightweight managers such as game, pathfinding, UI, and audio with a generic MonoBehaviour type T.
Detect input positions from mouse clicks or touch and register clicks on release, using the game manager to obtain screen position and prepare for transforming it to world space.
Track the initial input position on mouse down or touch begin, measure the distance to release, and trigger a click only when the movement is under a small threshold.
Convert screen space clicks to world points and command the active unit to move to the clicked ground position via a move to destination method.
Select active units by clicking on them to set the game manager's active unit, then click the ground to move, using raycast detection and unit colliders.
Select the active unit with raycasting, then move it and flip the warrior’s sprite by adjusting the sprite renderer flip x to face left or right.
Select a unit and display its outline using the outline shader and create a standard sprite material for the warrior and builder.
Highlight units on selection by swapping to an outline material, and manage selection with select and deselect methods to ensure only one unit is highlighted at a time.
Load a highlight material at runtime by moving it into a resources/materials folder and using Resources.Load<Material> to apply the outline material during unit selection.
Load materials from the resources folder and display a point-to-click cursor at the clicked ground. Instantiate a point-to-click prefab on click and destroy it after a short duration.
Explore how to implement a fade-out for a point-to-click effect in Unity 2D by adjusting a sprite renderer's alpha during the last 10% of its 1-second duration.
Animate the point-to-click effect with animation curves, adjusting x and y scale over time using a timer and curve evaluation for a crisp, oscillating feedback.
Select a unit and click the ground to move it, but only display the effect when the active unit is humanoid, via an isHumanoid check.
Switch the build target to iOS via build profiles to test your Unity 2D game on mobile, adjusting screen aspects from iPhone SE to iPhone 11 in landscape and portrait.
Learn to deselect an active unit in a Unity 2D RTS game by detecting clicks on the active unit and canceling it, enabling clean toggling of selection.
Learn to implement a bottom action bar in a Unity 2D RTS HUD, displaying unit-specific actions with icons and buttons, anchored to the screen bottom and responsive to screen size.
Implement a Unity action bar that remains hidden by default and reveals when a unit is selected, using an action bar script to toggle background image alpha and show actions.
Instantiate action button prefabs, assign button and icon images, and add them to an action bar; use register and clear actions in the game manager to display unit actions.
Detect UI clicks to prevent unit movement and selection from UI, and implement new getter properties to simplify input handling for both touch and mouse in Unity.
Hide the action bar when deselecting the active unit by clearing the action bar UI, check the bar's active state, adjust opacity, and destroy buttons; test in play mode.
Build a dynamic action bar in Unity using scriptable objects, define a base action and actions (build, attack, cancel) with icons and costs, and execute actions via the game manager.
Implement dynamic action bars for units by showing actions only when available, iterating actions to register action buttons, and preparing icon configuration for future updates.
Display the tower icon in the action button by passing its sprite to action bar and initializing the button, then adjust the icon in the sprite editor to square dimensions.
Hook the action button to trigger the build process in the game manager, invoking start build process via the action's execute method and wiring UI button clicks to actions.
Implement a placement process in Unity to show the building outline, update its position each frame, and place buildings through the game manager using a build action.
Learn to implement a placement outline for tower building in Unity 2D, including creating a placement outline object, assigning a sprite, and adjusting opacity for an outline.
Move the placement outline by converting screen coordinates from mouse or touch into world space, updating the outline position during build placement, and refining behavior across desktop and mobile.
Refactor input handling into a static HVO utils class to improve readability, reuse across game manager and placement logic, and streamline world position and input hold calculations.
Refactor input handling by moving short click and hold position logic into HVO utils, creating reusable methods for touch and mouse input.
Implement snapping to the grid for building placement by flooring the world position to integer coordinates and aligning the placement outline with the tile map.
Extend the placement system by highlighting tiles that mark buildable and blocked grid tiles for a 2×3 building, using an origin outline position and a highlight positions array.
Learn to highlight walkable tiles in a Unity 2D tile map by accessing tiles, unlocking them to adjust color, and setting tile colors to visualize terrain for RTS gameplay.
Learn how to offset the origin to the left-bottom corner for building placement in Unity 2D RTS, using building size and origin offset to align tiles with the pivot position.
Use an overlay tile map to highlight tiles by placing new semi-transparent tiles on top of the walkable layer, and pass the overlay to the placement process.
This lecture demonstrates a new approach to highlighting tiles using an overlay tile map layer, painting the map blue, and clearing old highlights before creating and displaying current building sites.
Implement highlighting of the current walkable tiles and coloring of blocked tiles to show where buildings cannot be placed, using a can place check against the walkable tile map.
Extend the build placement checks to include an unreachable tile map alongside the walkable tile map. Update the game manager and placement process to prevent building on unreachable tiles.
Learn to prevent building on blocked tiles with Unity 2D overlap checks, middle tile positions, and collider layers. Implement player-layer blocking and test collider sizes for accurate placement.
This course is made in latest Unity 6, but is still compatible with older versions of Unity.
Build a Fully Functional Mobile RTS Game in Unity 2D and Publish It to the App Stores
This course offers a complete, step-by-step guide to developing, designing, and publishing a mobile real-time strategy (RTS) game using Unity 2D and C#. It’s perfect for beginners who want to learn game development from scratch and for experienced developers looking to expand their skills in mobile RTS game creation.
What Makes This Course Unique?
You’ll work on a single project from start to finish—building every feature yourself without relying on third-party libraries. This ensures you learn not just the "how," but also the "why" behind every system and mechanic.
Course Highlights:
Setup Your Game Environment:
Start by setting up your Unity project and designing a game map with tilemaps and animated tiles. Learn to create dynamic environments and design immersive visuals for your RTS game.
Character Creation and Animation:
Animate game characters, including builders and warriors, with unique behaviors and appearances. Master Unity’s animation tools to make your game come alive.
Game Mechanics:
Implement crucial gameplay systems like:
Unit selection and movement with click-based interaction.
Building placement and confirmation workflows, complete with real-time visual feedback.
Unit actions, such as gathering resources, constructing buildings, and combat engagement.
Resource Management System:
Develop a resource economy where units collect and store wood and gold, enabling players to construct structures, train units, and unlock new gameplay opportunities.
Pathfinding with A* Algorithm:
Learn the fundamentals of pathfinding as you code your own A* algorithm. Ensure that units can navigate obstacles and follow smooth movement patterns on the game map.
Enemy AI and State Machines:
Program intelligent enemy behaviors using state machines, including movement, targeting, and attacking. Create dynamic enemy waves with unique challenges.
Combat System and Unit AI:
Design a combat system where units engage in battles with enemy waves. Implement stances like defensive and offensive modes, enabling strategic control of player units.
Game Polishing:
Enhance the user experience by adding features like:
Damage popups and event announcements.
Audio effects for footsteps, attacks, resource collection, and more.
Camera controls for smooth navigation across the map.
Final Game Improvements and Publishing:
Test your game on iOS and Android devices, ensuring performance optimization. Learn the full deployment process for both platforms, including:
Setting up store pages.
Creating preview videos.
Complying with store guidelines for publishing.
By the End of This Course:
You’ll have a fully functional RTS game ready for release on mobile app stores. Moreover, you’ll gain the skills to create, code, and publish future games, setting you on a path toward becoming a professional game developer.