-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code is not working on Visual Studio code #56
Comments
Please provide more details... how did you attempt to run in. What operating system are you running? |
I am using Windows 10, and i have visual studio 2017, when noticed that the instructor is using visual studio, i searched google for an extension for running love2D into visual studio, when i clicked install it opens visual studio code window, in fact i am not sure if the plugin installed correctly or not, when first time i pressed F5 to run the code, t asked my about the interpreter, and i chosen Lua, and it starts running, as if the code stops at a break point or something at line 23, and an orange status bar down the window show no messages, then i pressed F5 again, and it gave me this message In fact, it will be very helpful and time saving if there is a step by step instruction and compile and run the code indifferent IDE's |
Unfortunately it is not possible to run the game using the 'run code' feature in VSC. You can run in using the terminal window in VSC but would need to either type out the full path to the love.exe each time or add love.exe to the win10 'path': There is a Love2d tutorial here: You still need to make sure that you have the Love2d game engine installed, if you do try dropping the folder containing main.lua file onto love.exe and let me know what happens. |
I installed a few plugins and run/debug Love with VSCode on Windows 10, if it helps this is how my setup looks:
|
I did not install local lua debuger extension so I cannot advise of this one.
|
I was replying to the original question by SabryPhys explaining how I successfully use Visual Studio Code (on both Windows 10 an MacOS) to launch and debug my assignments from inside Visual Studio Code. The if conditions I added in step 8 are only necessary if you wish to use the debugger, set breakpoints and see callstacks. Yes, Love2d is not a lua debugger but after the Love2D process launches specified by the command location in the configuration profile, it runs your main.lua and those if conditions allow Visual Studio Code to connect the debugger to the Lua process if you launched with the debugger. They are ignored if you launch with the regular run button. The lua-local configuration profile is what enables this facility and it made learning and troubleshooting my Love2d program more enjoyable. |
Thank you for clarifying. |
Thanks for the information. I just changed |
I am using visual studio code, as the instructor in first lecture,
but it didn't work
and i got this message
Exception has occurred: [C]:-1: attempt to index a nil value (global 'love')
stack traceback:
main.lua:29: in main chunk
[C]: in ?
The text was updated successfully, but these errors were encountered: