Chapter 35: Prototype 7: Dungeon Delver
In this chapter, you make a top-down adventure game similar to the original Legend of Zelda for the NES. This chapter replaces the QuickSnap and Omega Mage prototypes from the first edition, and the new chapter includes much more component-oriented coding and a more interesting game.
Dungeon Delver Level Editor Package
Unity 2018.2.2 – Camera.main Bug
- In Unity 2018.2.2, sometimes when creating a Camera, the tag of the Camera is set to “Untagged” instead of “MainCamera”. As a result, any references to Camera.main will cause Null Reference Exceptions.
- To remedy this, all you need to do is set the tag of the Main Camera to MainCamera.
Small Unity 2017+ Issues
- The second edition was written before Unity announced or released their Tilemap engine for 2D games, so the Dungeon Delver tutorial (Ch. 35) uses an engine that I wrote instead. However, the Unity Tilemap engine does cause scripts of specific names to have unique icons. These include “Tile”, “GameManager”, and others. If you see a strange icon for these scripts, it’s nothing to worry about.
Minor Errata in Text
- p.846 – At the top of the page, in the non-bold code from before, this line:
eTileNum = TileCamera.MAP[x,y];
should instead read:
eTileNum = TileCamera.GET_MAP(x,y);
Thanks to Brandon Azer for noticing this error.