my first battle simulation, in rpg-style, using js