Help with starting
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Tue May 11, 2021 11:45 pm
Help with starting
So, im not sure if i missed something, or if this is how its supposed to work, but i opened LOVE and it just said no game, can anyone tell me what i should do or what i did wrong? Thank you!
Re: Help with starting
Check the wiki: https://love2d.org/wiki/Getting_Started
Basically, you need to create a main.lua file in a folder, and then tell LÖVE to run that folder.
Basically, you need to create a main.lua file in a folder, and then tell LÖVE to run that folder.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Help with starting
To expand upon ReFreezed's response, You'll want to make a new folder and put a file called main.lua inside it.
Now you can run the code by dragging and dropping the folder containing main.lua onto love2d's .exe file. The result will be the dot moving diagonally from the top left to down and to the right.
Other Love2d predefined functions can be found here. This should help you get a grasp of how you can interact with Love2d. Love2d is absolutely BLESSED with phenomenal wiki support. If you look on the left hand side of the wiki you'll see a menu that should help direct you to a good place to find what you need.
Code: Select all
-- main.lua
function love.load()
-- set up your initial variables here. Love2d will call this for you. No need to call it yourself.
x = 0
y = 0
end
function love.update(dt) -- dt stands for delta time. Basically using it will modulate everything to the second. See below.
x = x + 10 * dt -- this will move by 10 pixels per second
y = y + 10 * dt -- without the dt x and y would move at a variable rate depending on your system performance.
end
function love.draw()
love.graphics.setColor(1,0,0,1) -- rgba ranging from 0-1
love.graphics.circle("fill", x, y, 5) -- draw a red circle at x,y with a radius of 5
end
Other Love2d predefined functions can be found here. This should help you get a grasp of how you can interact with Love2d. Love2d is absolutely BLESSED with phenomenal wiki support. If you look on the left hand side of the wiki you'll see a menu that should help direct you to a good place to find what you need.
Re: Help with starting
I have a batch file that I use to start Lua programs in development, something like this:
You can change "Lua Game" to any text.. that's the title of the window that opens with the game in it. I think this actually gets ignored, since LOVE sets the title itself.
You also need the main.lua (as described above).
Then run the batch file to start the game.
Once you have a fairly complete package, you can create a LOVE file, which is basically a packaged version of the code and assets... but this is where you start.
Code: Select all
%~d0
cd %~dp0
start "Lua Game" "C:\Program Files\LOVE\love.exe" %~dp0
You also need the main.lua (as described above).
Then run the batch file to start the game.
Once you have a fairly complete package, you can create a LOVE file, which is basically a packaged version of the code and assets... but this is where you start.
Re: Help with starting
https://studio.zerobrane.com/ nice IDE for Lua and LoveLitPotato2895 wrote: ↑Tue May 11, 2021 11:54 pm So, im not sure if i missed something, or if this is how its supposed to work, but i opened LOVE and it just said no game, can anyone tell me what i should do or what i did wrong? Thank you!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests