var boat,groundImage; //variables declared
function preload(){
boat = loadAnimation("b2.png"); //loading animation
groundImage = loadImage("b1.jpg");
}
function setup() {
createCanvas(600, 400); //draw canvas
}
function draw()
{
background(180);
image(groundImage,0,0);
animation(boat,0,0); //locate animation
}
here is a simple code for using animation in p5.js editor. But I got an error as: ReferenceError: loadAnimation is not defined at /sketch.js:6:3
Aucun commentaire:
Enregistrer un commentaire