Template library for 2d games