I have a student that has a game that he would like to run outside of code.org. He has put all of his code in an index.html file so that he can run it on Visual Studio. The problem he is having is that when he goes to run it he gets an error code that says “createSprite is not defined.” He is running it on Live Server extenstion. for Visual Studio. After he gets the createSprite is not defined, the next line says: “Failed to load resources the server responded with a status of 404 not found.”
The question is is how can he get code to run outside of code.org. He wants to begin creating things outside and wants to know how to run the code/program. How can he do that?
Here is what he is trying to run:
var snowman = createSprite(300,300);
snowman.setAnimation(“snowmanL.png”);
function draw() {
background(“grey”);
if (keyDown(“a”)) {
snowman.setAnimation(“snowmanL.png”);
snowman.x = snowman.x - 5;
}
if (keyDown(“d”)) {
snowman.setAnimation(“snowmanR.png”);
snowman.x = snowman.x + 5;
}
if (keyDown(“space”))
snowman.rotation = randomNumber(10,360)
drawSprites();
}