I'm trying to animate some Sprites Sheets, but I'm having a problem with a certain "shadow" that remains after the canvas runs the animation frame, it would be the previous frame, I can not fix it.
Full code in JSFiddle: link .
I think the error is in the loop that does not remove the data from the previous frame, but I have no idea how to remove it from the array, I would be grateful for any help you could offer.