我无法在love2D中运行lua游戏

发布于 2025-01-13 08:21:12 字数 415 浏览 7 评论 0原文

当我尝试运行游戏时,收到此错误:

Error

[love "boot.lua"]:323: Cannot load game at path 'C:/Users/LENOVO/Desktop/LUA-Projects- 
master/projects/3.Battle_arena.lua'.
Make sure a folder exists at the specified path.


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'error'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

注意:我通过将 lua 文件拖放到 love2D 应用程序窗口来运行该文件。

When I try to run the game, I receive this error:

Error

[love "boot.lua"]:323: Cannot load game at path 'C:/Users/LENOVO/Desktop/LUA-Projects- 
master/projects/3.Battle_arena.lua'.
Make sure a folder exists at the specified path.


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'error'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

Note: I'm running the lua file by dropping it on the love2D application window.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谜兔 2025-01-20 08:21:12

您必须将包含 main.lua 的目录拖到 love 可执行文件上。对于您的情况,假设您的文件是入口点,请将 3.Battle_arena.lua 重命名为 main.lua

来自入门

LÖVE 可以通过两种方式加载游戏:

  • 来自包含 main.lua 文件的文件夹。
  • 来自一个 .love 文件,该文件在最顶层目录级别(也称为根目录)中有一个 main.lua 文件

You have to drag the directory containing a main.lua onto the love executable. In your case, rename 3.Battle_arena.lua to main.lua, assuming your file is the entry point.

From Getting Started

LÖVE can load a game in two ways:

  • From a folder that contains a main.lua file.
  • From a .love file that has a main.lua file in the top-most directory level (aka root)
极度宠爱 2025-01-20 08:21:12

你的游戏文件夹中有 main.lua 吗? love2d 需要游戏文件夹中有 main.lua 才能运行游戏,将 3.Battle_arena.lua 重命名为 main.lua

如果您有任何其他问题,请尝试访问 love2d.org

do you have a main.lua in the game folder? love2d requires the game folder to have main.lua in order to run the game, rename 3.Battle_arena.lua to main.lua.

if you have any other problems try visiting love2d.org

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文