'i can't run a lua game in 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.



Solution 1:[1]

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)

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Luke100000
Solution 2 freeve4