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”);