Reputation: 75
I installed LOVE2D into the program files path, I added it to the environment variables, and I installed LOVE2D Support into Visual studio code. Why are the variable still showing up with the error "Undefined global love
"? Can someone help me find an answer? This program does run by drag and drop as well
Edit 1: here is the base code itself. I also want to add that it now runs (still does not register love functions) but its when I press Ctrl+S rather than Alt+L. It also runs the file in the main folder as well rather than the one I want to run, being this one (maybe its because the folder is not the main one selected?)
Edit 2: Here is the code instead. I would just like the answer to this question:
function love.load()
love.window.setTitle("Hello LÖVE")
love.graphics.setNewFont(24)
end
function love.draw()
love.graphics.printf("Welcome to LÖVE", 0, love.graphics.getHeight() / 2 , love.graphics.getWidth(), "center")
end
Upvotes: 1
Views: 477
Reputation: 23
To run a love game, you need to indicate only the name of the folder that contains main.lua: love myFolder
.
Also, love.exe path must be in the Environment Variables
Upvotes: 0