Rename makeEntity params to (gx,gy). Remove offscreen entities. Determine tile by entity center. Add undefined handling to utility functions. Cleanup tower code.