I don't how to set up Love

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
butch
Prole
Posts: 2
Joined: Mon Sep 07, 2020 6:00 pm

I don't how to set up Love

Post by butch »

I don't how to set up Love to work with Lua. My attempt to execute your sample function replies that love is nil:

function love.draw()
love.graphics.print("Hello World", 400, 300)
end

I am on MX Linux and have installed lua 5.3 and love 11.2.2 using Synaptic from the MX repositories.
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: I don't how to set up Love

Post by pgimeno »

You don't run Lua, you run Love.

Your Lua file must be called 'main.lua'. Note that Love requires a folder, not a file. You need to pass it the folder where 'main.lua' is located.

Maybe this video helps: http://www.youtube.com/watch?v=ZQCky-_Ad5Y

You can't choose the version of Lua that is run, it's always the one embedded in Löve, which is LuaJIT, compatible with Lua 5.1.

You may be lucky running Love as a module from Lua, as long as you use Lua 5.1 or LuaJIT. If you're interested I can elaborate.
butch
Prole
Posts: 2
Joined: Mon Sep 07, 2020 6:00 pm

Re: I don't how to set up Love

Post by butch »

Thank you, Pgimeno. I literally had the cart before the horse. I was starting out to learn Lua and then noticed all of the gaming that utilized it. It never occured to me that Love had Lua embedded. Thank you for the pointer to that tutorial. I think that at my current level I will pass on trying to run Love as a module.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 7 guests