Chapter 8. Encountering Enemies and Running Away

At the heart of most RPG-style games are the bad guys. How they think and how they confront and challenge you will mark your game as either too hard or too easy. Sadly, there isn't any real middle ground (you can't please everyone all the time). However, we can ensure a fair system and engage the players with systems that will surprise and entertain them as they move around in the big bad world.

The following topics will be covered in this chapter:

  • Planning for event systems
  • State machines
  • Basic AI techniques

Event systems

When you're looking to engage the player roaming around in your game, it is best to throw them off guard and challenge them when they least expect it; this ensures that the player is ...

Get Mastering Unity 2D Game Development - Second Edition 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.