The JavaScript code below implements a simple turn-based combat engine for a Japanese-style RPG in JavaScript. To see the source code, or make a comment, visit It's not really finished yet, but as usual, I figured I'd put it out here before I lose interest for the time being. Use the arrow and Enter keys to navigate the menus and choose targets for attacks.