export const spriteCache = new Map();

export function loadSprite(path) {
    if (path === '') {
        return null;
    }
    if (spriteCache.has(path)) {
        return spriteCache.get(path);
    }

    const image = new Image();
    image.src = path;
    spriteCache.set(path, image);
    return image;
}