Javascript 2D RPG game engine