I am following the following tutorial on how to make a space invaders game - http://www.html5rocks.com/en/tutorials/canvas/notearsgame/
However error message in the title is displayed when this code is executed and the game doesn't display. The invalid label indicates that the "y" at the start of the second line within the return function is the culprit of the error.
player.midpoint = function()
{
return
{
x: this.x + this.width/2,
y: this.y + this.height/2
};
};
However when I take this code out the game runs fine, only when I press space to fire the game freezes as it requires the above function to fire bullets.