Hey everybody!
I just watched this video:
http://vimeo.com/36579366
and I also re-watched a little bit of Notch's Ludum Dare 22 live stream, and both environments seem to rely on code updating without restarting the program.
I imagine this is possible with LOVE2D -- has anybody tried it?
-Nick
Hot Reload
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Hot Reload
I haven't tried it, but I think it should be possible if you have a scaffolding in your main.lua, and the actual game is located in a subdirectory or something.
It would probably be a good idea to reload the code once focus has been returned to the game:
It would probably be a good idea to reload the code once focus has been returned to the game:
Code: Select all
function love.focus(f)
if f then
-- reload code
end
fakelove.focus(f) -- this calls the love.focus in the game
end
Help us help you: attach a .love.
Re: Hot Reload
There's a library called LICK: https://github.com/headchant/lick
It enables live coding for LÖVE.
But it doesn't work that well on all projects, respectively on advanced ones.
It enables live coding for LÖVE.
But it doesn't work that well on all projects, respectively on advanced ones.
"Docendo discimus" - Lucius Annaeus Seneca
Re: Hot Reload
I had a thread about this recently (it's on page 2, link), and the summary of it is basically use LICK, or use the love.load version that accepts an arg table parameter, and read out an option that'll move you to the level you wanted to test. I think I like the second option better.
live-coding still sounds sweet though, if you figure out anything, let us know.
live-coding still sounds sweet though, if you figure out anything, let us know.
-
- Party member
- Posts: 227
- Joined: Thu Jun 28, 2012 8:46 pm
Re: Hot Reload
I have live coding in the IDE I've been working on ZeroBraneStudio and did a screencast based on Bret Victor's presentation about three months ago (http://notebook.kulchenko.com/zerobrane ... ctor-style). The IDE also provides Löve integration and the same live coding can be used with Löve too, as shown in this screencast: http://notebook.kulchenko.com/zerobrane ... -with-love.
The mechanism is different from Lick as the application doesn't have any Löve specific logic and runs under a "normal" debugger, which has its own advantages and disadvantages. The main disadvantage is that I can't intercept run-time errors at the moment (which is something I'm working on). All the compilation errors are intercepted and reported in the IDE.
The mechanism is different from Lick as the application doesn't have any Löve specific logic and runs under a "normal" debugger, which has its own advantages and disadvantages. The main disadvantage is that I can't intercept run-time errors at the moment (which is something I'm working on). All the compilation errors are intercepted and reported in the IDE.
Last edited by paulclinger on Fri Sep 21, 2012 2:51 am, edited 1 time in total.
Re: Hot Reload
Thanks for all the replies! Looks like I have a lot of reading to do...
Re: Hot Reload
This enables hot reload:racarate wrote:Thanks for all the replies! Looks like I have a lot of reading to do...
package.loaded[state]=false
require(state)
state = e.g. "main"
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Hot Reload
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Hot Reload
very nice, josefnpat! basically same idea as mine, just somebody spent more time on prototyping it for actual debugging :-)
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Hot Reload
LICK is outdated, LoveDebug uses LICK's (updated) code for hotswapping.
Who is online
Users browsing this forum: Ahrefs [Bot] and 10 guests