App Lab unexpected token

To whom it may relate, my student is receiving an error message in app lab “Step out Step in
ERROR: Line: 7: SyntaxError: Unexpected token (7:17)”… We tried to retype the code and its still not working.

Here are the codes my student is using:

onEvent(“Space_Hunter”, “keydown”, function( ) {
var shipX = getXPosition (“image_ship”);
var shipY = getYposition (“image_ship”);

var distance = 12;

if(event.key = “Up”)
{
shipY = shipY - distance;
}

if (event.key = “Down”)

shipY = shipY + distance;
}

setPosition(“image_ship”, shipX, shipY);
));

function verticalWrapsAround(object)
{
var objectX = getXposition(object);
var objectY = getYPosition(object);

var objectHeight = getProperty(object,“height”);

if(objectY <0- objectheight/2))
var objectheight=getProperty(object, “height”);

I’ve tried but it’s not working. I want my ship to move up and down. Here are my codes.

onEvent(“screen1”, “click”, function( ) {
console.log(“image_ship clicked!”);
var shipX = getXPosition(“image_ship”);
var shipY = getYPosition(“image_ship”);

var distance = 12;

if(“event”.key = “Up”)
{
shipY = shipY - distance;
}

if(“event”.key = “Down”)
{
shipY = shipY + distance;
}

setPosition(“image_ship”, shipX, shipY);
});

Try watching this video and see if that helps.

Thanks, I will be watching. I am running into an error that states ship x is defined but not called in my program. How can I fix this problem?

We have to be careful about how much help is given in the open like this. Students are not allowed to get help on the Create Task.

Hello,
Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you.

Link to the project or level: This can be a share link to the program so we are able to see both the code and how it interfaces with the design elements.
What I expect to happen: So we know where to focus our attention
What actually happens: To make sure we’re seeing the same things
What I’ve tried: So we’re not reinventing the wheel, and to understand your thought process.

Would you please include these items so we can help address the issue?

That said - Don is correct that we are unable to help with questions that may be related to the create task, so may not be able to help beyond George’s video suggestion if this does not tie directly to a portion of the curriculum.