【问题标题】:Console error: 'Uncaught SyntaxError: Unexpected token : Learning sprites' [closed]控制台错误:'Uncaught SyntaxError:Unexpected token:Learning sprites' [关闭]
【发布时间】:2018-08-27 23:39:08
【问题描述】:

这是我的code(我链接它是因为我不知道问题出在哪里,我不想将它全部链接到这篇文章)。我在控制台中收到此错误:
错误在第 57 行,但我不知道出了什么问题。

rectangle = {
    height : 32,
    jumping : true,
    width : 32;
    x : 144,
    x_velocity : 0,
    y : 0,
    y_velocity : 0
};

【问题讨论】:

  • 查看错误。然后仔细查看生成它的行,答案对你来说是显而易见的。
  • 我不敢相信我没有看到。很郁闷

标签: javascript html sprite unexpected-token


【解决方案1】:

只是一个小的语法错误导致了您的错误。更新这一行:

rectangle = {
                height : 32,
                jumping : true,
                width : 32, // Replace ; with ,
                x : 144,
                x_velocity : 0,
                y : 0,
                y_velocity : 0
            };

【讨论】:

  • 哇,我不敢相信我没有看到。谢谢。
  • 不客气 :-)
猜你喜欢
  • 2015-09-30
  • 1970-01-01
  • 1970-01-01
  • 2018-02-01
  • 2012-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多