PAC-MAN fully recreated in vanilla Minecraft, complete with original ghost AIs

What happens when you push the limits of command blocks and resource packs in Minecraft? The original PAC-MAN game in Minecraft happens. YouTube user MrSquishy uploaded this video yesterday of a fully-functioning replica of PAC-MAN inside Minecraft, complete with an arcade machine replica.

https://youtu.be/CABRF7e4DQE

But how does it work? Essentially it uses a custom resource pack (containing animations and retextures) and a LOT of Redstone to faithfully recreate the original game inside of Minecraft. If it was screen-recorded with just the display, you couldn't tell it was inside Minecraft. Now if you will excuse me, I'm going back to playing Doom inside Doom 3.