I am making a space shooter style game, and the code I have made so far was working 2 days ago but now I am getting this error: Uncaught DOMException: CanvasRenderingContext2D.drawImage: Passed-in image is “broken”
here is some of the code.
I define the image here:
const baddie = new Image();
baddie.src = './space_shooter_baddie.jpg';
and i am getting the error on this line:
ctx.drawImage(baddie, 0, 0, 28, 28, badx[i], bady[i], 28, 28);
could someone please tell me what this means? thank you.