Hello,
So I am using ZeroBrane Studio Lua IDE, was really easy to set up. This actually might be a question for them but I thought I'd see if I could get some help here. So you have to have main.lua as your main file correct? I've been doing these tutorials and I like to make new files and save the previous before additions so I can always backtrack the progression of how I ended up at this current source.
How can I test different files without renaming each file to main.lua? I hope that makes sense. For example collision_circles.lua and arrow_follow.lua . Is there a more simple way of running each individual file, without renaming them to main.lua? I'm still learning how to navigate around Lua, so I'm assuming there is a way to just run various lua examples from a main.lua.
Thanks, have a great day.
Testing Different Projects
Re: Testing Different Projects
Just have a single line in main.lua where you require() the file you want to run.
Code: Select all
require("collision_circles")
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: Testing Different Projects
So 2 files have love.load, load.update, load.draw that will still work?
Re: Testing Different Projects
Something like
Code: Select all
require ("main-old")
-- require ("main-new")
Re: Testing Different Projects
Only the files you require() will actually run, so if you only call require("collision_circles") in main.lua then it doesn't matter what arrow_follow.lua or any other file contains as those will not run.
main.lua:
collision_circles.lua:
arrow_follow.lua:
main.lua:
Code: Select all
-- Only uncomment one line:
-- require("collision_circles") -- Uncomment to run the collision_circles.lua file.
-- require("arrow_follow") -- Uncomment to run the arrow_follow.lua file.
Code: Select all
function love.draw()
love.graphics.print("collision_circles!!!")
end
Code: Select all
function love.draw()
love.graphics.print("arrow_follow!!!")
end
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: Testing Different Projects
I think most ppl just have different folders for different projects and each has a main.lua.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
Who is online
Users browsing this forum: Google [Bot] and 2 guests