let background, sleeping, brushing, gyming, eating, drinking, moving, astronaut;
function preload()
{
background = loadImage("images/iss.png");
sleeping = loadAnimation("images/sleep.png");
brushing = loadAnimation("images/brush.png");
gyming = loadAnimation("images/gym1.png","images/gym1.png","images/gym2.png","images/gym12.png");
eating = loadAnimation("images/eat1.png", "images/eat2.png");
drinking = loadAnimation("images/drink1.png", "images/drink2.");
moving = loadAnimation("images/move.png", "images/move1.png");
}
function setup()
{
createCanvas(400, 400);
astronaut = createSprite(300, 200);
astronaut.addAnimation("sleeping", sleeping);
astronaut.scale = 0.3;
}
function draw()
{
background(background);
drawSprites();
}
I have double-checked my typing and the image files being loaded. However, the code doesn't seem to be functioning properly.
Visit the following link to access the file: