public static BufferedImage getSprite(String file, int tileSize, int xGrid, int yGrid) {
        if (spriteSheet == null) {
            spriteSheet = loadSprite(file);
        }
        return spriteSheet.getSubimage(xGrid * tileSize, yGrid * tileSize, tileSize, tileSize);
    }