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 https://thiscouldbebetter.wordpress.com/2014/07/03/a-turn-based-combat-image-for-an-rpg-in-javascript/. 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.