Unity 5: 2D Movement in an RPG Game
1h 22mIntermediate2016-08-08
Authors

Jesse Freeman
Head of Partner and Framework Marketing at Amazon
Course details
Learn how to move a player on a tile-based 2D map and use that movement to trigger events—creating a gaming experience similar to classic RPGs. In this course, Jesse Freeman builds upon the lessons learned in the Unity 5 2D: Random Map Generation: adding a player, moving the player from tile to tile, and making the camera follow the movement, as well as triggering events on the map. Jesse also shows how to add a "fog of war" effect that reveals parts of the map as the player moves around and explores, and how to detect and update the artwork for visited tiles.
Learning objectives
Setting up the project
Adding and repositioning the player in the map
Listening to movement
Moving the player
Triggering events from movement
Adding fog
Tracking visited tiles
Expanding the player's field of view
Learning objectives
Setting up the project
Adding and repositioning the player in the map
Listening to movement
Moving the player
Triggering events from movement
Adding fog
Tracking visited tiles
Expanding the player's field of view
Skills covered
Real-Time ScriptingReal-TimeGame DevelopmentUnityVisualization and Real-TimeAECProduct and ManufacturingSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Welcome
- 02 - Exercise files
1. Creating the Player
- 03 - Set up the project
- 04 - Import artwork and animations
- 05 - Add the player to the map
- 06 - Map position utility
- 07 - Reposition the player
2. Moving the Player
- 08 - Player movement class
- 09 - Listen to movement
- 10 - Detect the tile to move to
- 11 - Move the player
- 12 - Limit movement
- 13 - Make the camera follow the player
3. Triggering Events from Movement
- 14 - Track player movement on tiles
- 15 - Start and stop walk animation
4. Fog of War
- 16 - Modify the map to hide tiles
- 17 - Extend the map tile renderer
- 18 - Track visited tiles
- 19 - Visit tiles
- 20 - Expand vision
- 21 - Clean up
Conclusion
- 22 - Next steps