Chapter 5. Building a Memory game using Unity’s new 2D functionality

This chapter covers

  • Displaying 2D graphics in Unity
  • Making objects clickable
  • Loading new images programmatically
  • Maintaining and displaying state using UI text
  • Loading levels and restarting the game

Up to now we’ve been working with 3D graphics. But you can also work with 2D graphics in Unity, so in this chapter you’ll build a 2D game to learn about that. We’re going to develop the classic children’s game Memory: we’ll display a grid of card backs, reveal the card front when it’s clicked, and score matches. These mechanics cover the basics you need to know in order to develop 2D games in Unity.

Although Unity originated as a tool for 3D games, it’s used often for 2D ...

Get Unity in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.