JS-based 2d game engine