I have a student who wants to flip between images to create their animation. They have two lightening bolt images. I can’t figure out why the code isn’t working. Would appreciate the help!
World.frameRate = 80;
noStroke();
background(“black”);
fill(“darkred”);
ellipse(75,150,50,35);
fill(“Black”);
ellipse(75,160,40,30);
fill(“darkred”);
rect(50,150,10,80);
rect(90,150,10,80);
rect(50,180,50,10);
ellipse(132,148,53,25);
rect(105,150,10,60);
ellipse(132,212,53,25);
fill(“Black”);
ellipse(132,202,35,25);
ellipse(132,155,35,25);
fill(“darkred”);
ellipse(200,180,100,100);
fill(“Black”);
rect(150,120,50,200);
ellipse(222,180,45,65);
fill(“darkred”);
rect(200,130,10,100);
ellipse(310,180,100,100);
fill(“Black”);
ellipse(320,180,100,85);
rect(335,130,200,200);
function draw() {
var litter = createSprite(175, 180);
litter.setAnimation(“Litter”);
litter.scale = 0.3;
drawSprites();
}
function draw() {
var lit = createSprite(175, 180);
lit.setAnimation(“Lit”);
lit.scale = 0.3;
drawSprites();
}