Lua语言进行游戏时一些bug的汇报

首先,我使用的是LUA学习,发现了不少问题:

1、无法订阅,按钮是无效的,点击了没有任何响应。
2、lua语言的很多关卡里预设的代码是js或者python的,必须自己用lua重写一次。:sob:
3、自动完成代码功能存在问题,很多时候写诸如“self:moveXY(x,y)”的代码,会被自动修正为“self:hero:moveXY(x,y)”,这样的代码会被判定为错误,导致游戏无法进行,必须手动修改。:sweat:
4、所有的函数和变量,都必须加上“local ”前缀,否则无法正常运行,但是预设代码和帮助里根本没写,新手一开始debug就要花不少时间。:smiling_imp:
5、有些关卡完全没有翻译,而且给出的代码也是c风格的,我想多半是js代码。

最后,虽然有这么多问题,但是我依靠github里的python代码还是玩到第三关了,非常感谢网站的作者和关卡设计师、翻译同学~:blush:

Please format your code according to the FAQ
https://discourse.codecombat.com/faq

请根据常见问题格式编码.
按照他放的链接。

This is for him in Chinese.

1 Like
  1. 现在应该可以订阅。若不能订阅,请贴出具体错误信息。

2.这取决于关卡设计师在设计的时候是否添加相应的默认代码。当然,普通玩家可以在关卡编辑器提交一份补丁。

3.确实有这样的bug,但值得注意的是,self已经过时,请使用更为通用的hero。

4.这可能是解释器的bug,但lua甚至其他语言都提倡使用局部变量。

5.除了2提到的原因,翻译可能跟不上关卡更新速度。希望有能力的同学能贡献一下翻译。

  1. It may work now. If not, please post the details.

  2. It depends on whether level designers have added the default code in specific languages. However, you can also submit a patch for it.

  3. The bug does exists. But ‘self’ is deprecated, and you should use universal ‘hero’ instead.

  4. It might be bug from parser. But it’s recommended to use local variables in Lua and other languages.

  5. Besides the reason above, the translations are still far from the end. I hope whoever have the ability to this should contribute to CodeCombat.