Moving Entites in a Turn-Based Game
Most traditional roguelike games (e.g. Nethack, Rogue, and Cogmind) are turn-based. You move, and then the enemies move. Even Diablo started as a turn-based game—the real-time movement aspect was added after play testing. Turn-based play provides for very tactical game play—you win games based on careful positioning and movement, and not with your reflexes. It’s also required by the game design document you wrote in Chapter 4, Design a Dungeon Crawler.
For a “you move, they move” cycle, you need three states: player moving, monsters moving, and waiting for input. You don’t need to do much while you wait for input other than poll the keyboard and mouse, so save someone’s laptop battery and do less. Separating ...
Get Hands-on Rust 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.