Error Message HELP

csdunit3
help

#1

I have a student who is stuck and I can’t figure out how to fix it. HELP
Here is the error message
download%20(57)

Here is the code:
// Variables
var score = 0;
// Create Sprites
var cake = createSprite(350,200);
cake.setAnimation(“burger_1”);

var player = createSprite(200,200);
player.setAnimation(“alienWalkRight”);

var enemy1 = createSprite();
enemy1.setAnimation(“ladybug”);
enemy1.velocityX = 2;
enemy1.x = 0;
enemy1.y = randomNumber(150, 250);

var enemy2 = createSprite();
enemy2.setAnimation(“ladybug_1”);
enemy2.velocityX = 2;
enemy2.x = 0;
enemy2.y = randomNumber(150, 250);

function draw() {
// draw the background
gameBackground();
// update the sprites
enemiesTouchcake();
movePlayer();
displaceEnemies();
enemiesTouchWater();
showScore();
drawSprites();
}

// Functions
function gameBackground() {
noStroke();
background(rgb(0,100,255));
fill(rgb(100,100,100));
rect(0,150,400,100);
fill(rgb(80,80,80));
rect(0,140,400,10);
rect(0,250,400,10);
}

function enemiesTouchCake(){
if (enemy1.isTouching(cake)) {
enemy1 = 0;
enemy1.y = randomNumber(150, 250);
score = score - 2;
}
if (enemy2.isTouching(cake)) {
enemy2 = 0;
enemy2.y = randomNumber(150, 250);
score = score - 2;
}
}

function movePlayer(){
if (keyDown(“right”)) {
player.setAnimation(“alienWalkRight”);
player.x = player.x + 3;
}
if (keyDown(“left”)) {
player.setAnimation(“alienWalkRight_copy_1”);
player.x = player.x - 3;
}
if (keyDown(“up”)) {
player.y = player.y - 3;
}
if (keyDown(“down”)) {
player.y = player.y + 3;
}
}

function displaceEnemies(){
if (player.isTouching(enemy1)) {
player.displace(enemy1);
}
if (player.isTouching(enemy2)) {
player.displace(enemy2);
}
}
function enemiesTouchWater(){
if (enemy1.y > 260) {
setEnemy1();
score = score + 1;
}
if (enemy1.y < 140) {
setEnemy1();
score = score + 1;
}
if (enemy2.y > 260) {
setEnemy2();
score = score + 1;
}
if (enemy2.y < 140) {
setEnemy2();
score = score + 1;
}
}

function setEnemy1() {
enemy1.y = 0;
enemy1.y = randomNumber(150, 250);
}
function setEnemy2() {
enemy2.x = 0;
enemy2.y = randomNumber(150, 250);
}
function showScore() {
fill(“white”);
textSize(20);
text(“Score”,20,20,200,100);
text(score,20,40,200,100);
}


#3

Is spelled wrong.

The C in cake should be capitalized.


#4

Thank you for all the help. Fixed.