a small javascript 2d engine