Today I did the attract mode for the latest version of Phalanx wrong in two entirely different ways. Fortunately, a conversation with a colleague taught me the right method in the end. Lest I forget in the future, here it is:
- Code your game so that inputs are stored, along with a time stamp. Preferably the inputs should be handled by a manager devoted entirely to them; it then sends the data to an intermediary, which in turn helps it get to everything that needs to know what the inputs were.
- In addition to the input manager, build a system that reads move records, sending “inputs” as the game timer reaches their associated time stamp.
- When there’s a great playtest game, put its record into the record player.
- Set up your game so that the intermediary reads from the input manager, your attract mode so that it gets “inputs” from the record player.
Voila! Exciting attract mode matches, all thanks to good code architecture.