Chapter 36: Dungeon Delver – Part 2

Introductionto Game; Design , Prototyping , and Development; From Concept to Playable Game with Unity and C#

This chapter will take the Dungeon Delver game that you began in the previous chapter from
a rough prototype to a “first playable” that you could share with others. This chapter adds many more elements to continue building our clone of one of the Nintendo Entertainment System’s best games, The Legend of Zelda.

Just like the other Part 2 chapters, you will need to complete Part 1 in Chapter 35 before beginning this chapter.

colld Variable Names in Code Listings 36.27 and 36.28

  • I made the mistake of naming a private Collider2D field of Grappler colld (in Code Listing 36.27) and also using colld as the name of the input parameter of Grappler.OnTriggerEnter2D() (in Code Listing 36.28).
This will not cause any bugs with the current code, but it is bad style to do so because anyone reading the code could get confused by the identical names. Additionally, the local colld variable in OnTriggerEnter2D() makes it difficult to access the Grappler.colld field inside of the OnTriggerEnter2D() method (you would need to use this.colld to do so).