That is, after all, the official pronunciation. ("Love")
EDIT: Btw, you do know that setColor accepts tables too (they have to use numerical indices though, iirc).
EDIT2: The update function gets called once, and exactly once for every drawn frame. (Though this isn't necessary, it's the case now, and always has been.)
EDIT3: Isn't it cleaner if you use the state either as the state table itself (so state = splash instead of state = "splash"), or use state as a table index (so states[state] or even _G[state])?
EDIT4: Why imgs["background"] instead of imgs.background? Also, game.load isn't needed in love.load, and enemy_rate-0.01*enemy_rate = 0.99*enemy_rate. Last thing (for now) is your use of table.remove in an ipairs loop.
EDIT5: What about doing l.g.draw(stuff, x*scale, y*scale) instead of storing the x and y scaled?
EDIT6: What's with all the magic numbers? If 12 is half of the player size, why not use player_size/2?
EDIT7: One of the slides is titled "game.lua:splash.draw", that should be splash.lua, of course.
[Video Tutorial] Love Tutorial ~45min
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: [Video Tutorial] Love Tutorial ~45min
Thanks for the clarification.bartbes wrote:That is, after all, the official pronunciation. ("Love")
News to me! Totally going into rev 2bartbes wrote:EDIT: Btw, you do know that setColor accepts tables too (they have to use numerical indices though, iirc).
I will make sure to say this properly, cheers.bartbes wrote:EDIT2: The update function gets called once, and exactly once for every drawn frame. (Though this isn't necessary, it's the case now, and always has been.)
Lovely idea, will make it happen.bartbes wrote:EDIT3: Isn't it cleaner if you use the state either as the state table itself (so state = splash instead of state = "splash"), or use state as a table index (so states[state] or even _G[state])?
bartbes wrote:EDIT4: Why imgs["background"] instead of imgs.background?
Code: Select all
[~]$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> imgs = {}
> imgs["background"] = "test"
> print(imgs.background)
test
No need to init it twice, good point.bartbes wrote:Also, game.load isn't needed in love.load, and
That's a good line, much clearer.bartbes wrote:enemy_rate-0.01*enemy_rate = 0.99*enemy_rate.
Mark for destruction, then remove later.bartbes wrote:Last thing (for now) is your use of table.remove in an ipairs loop.
Might be clearer, i'll see what I can do.bartbes wrote:EDIT5: What about doing l.g.draw(stuff, x*scale, y*scale) instead of storing the x and y scaled?
Yep, this is something that threw me off too as I was recording it. Intended to fix this.bartbes wrote:EDIT6: What's with all the magic numbers? If 12 is half of the player size, why not use player_size/2?
Yay, typos!bartbes wrote:EDIT7: One of the slides is titled "game.lua:splash.draw", that should be splash.lua, of course.
But seriously, thanks Bartbes. Will have lots of fun stuff for v2.0
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: [Video Tutorial] Love Tutorial ~45min
This is awesome! Thanks so much for making this.
Highly subjective and not-very-useful critique time, woo!
I saw "Ogg" and assumed it was audio. Perhaps renaming it "Ogg video" or something might help people who didn't read the first post very well. Like me. Thanks for providing 7z links, it's a great format.
I think that the text could be more readable. Is it possible to make the resolution 720 or 1080? Maybe changing the colours a bit to increase the contrast of the text would help too. Syntax highlighting would be amazing if you could find some plugin or something to do it for you. You could probably get away with increasing the font size too. Also using anything but Courier would benefit readability/aesthetics in my highly subjective opinion.
Could "main.lua:love.load()" etc. be mistaken for Lua syntax? Probably not. Just putting that out there.
Enemies don't move completely off screen before they disappear.
Highly subjective and not-very-useful critique time, woo!
I saw "Ogg" and assumed it was audio. Perhaps renaming it "Ogg video" or something might help people who didn't read the first post very well. Like me. Thanks for providing 7z links, it's a great format.
I think that the text could be more readable. Is it possible to make the resolution 720 or 1080? Maybe changing the colours a bit to increase the contrast of the text would help too. Syntax highlighting would be amazing if you could find some plugin or something to do it for you. You could probably get away with increasing the font size too. Also using anything but Courier would benefit readability/aesthetics in my highly subjective opinion.
Could "main.lua:love.load()" etc. be mistaken for Lua syntax? Probably not. Just putting that out there.
Enemies don't move completely off screen before they disappear.
Could someone please explain to me why this is a good practice?josefnpat wrote:Mark for destruction, then remove later.bartbes wrote:Last thing (for now) is your use of table.remove in an ipairs loop.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [Video Tutorial] Love Tutorial ~45min
Because when you use table.remove, it removes the index and then goes through the entire table to move each entry after the removal point up one. Not only is it slow, but if you are running through the table in a for loop, you end up shifting all the table entry indexes and confuse the crap out of the for.Santos wrote:Could someone please explain to me why this is a good practice?
By marking them for deletion and removing them in a separate loop you avoid conflicts and slowdown.
My method is to create an empty "removal table" at the start of the update loop (Anywhere before your update loop) then while running through your table, for instance a bullet table, you A) mark the bullet as "dead" and B) add an entry to the "removal table" with that bullets index, then after you're done, you run through the "removal table" removing all items from the bullet table with that index.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: [Video Tutorial] Love Tutorial ~45min
Thank you Santos, I'm glad you liked it.Santos wrote:This is awesome! Thanks so much for making this.
Highly subjective and not-very-useful critique time, woo!
I was originally going to title them "Ogv",but changed my mind as the wikipedia page referenced them as the "Ogg container format".Santos wrote:I saw "Ogg" and assumed it was audio. Perhaps renaming it "Ogg video" or something might help people who didn't read the first post very well. Like me. Thanks for providing 7z links, it's a great format.
What if I used "Theora/Ogg video" ?
I agree, and I had a lot of production issues. Pitivi seems to really like jpeg compression for some reason, so the quality goes right down the shitter. I need to get a better workflow. The ogv on the site is actually 720 x 576, but for the next version, I will concentrate on getting a better output size.Santos wrote:I think that the text could be more readable. Is it possible to make the resolution 720 or 1080? Maybe changing the colours a bit to increase the contrast of the text would help too.
I was using google docs for this, so it didn't offer much highlighting. Maybe I can copy paste code from codepad.org or something. I like this idea very much.Santos wrote:Syntax highlighting would be amazing if you could find some plugin or something to do it for you. You could probably get away with increasing the font size too. Also using anything but Courier would benefit readability/aesthetics in my highly subjective opinion.
As for courier, I hate it too, but it was the only real monospace font google docs would allow. Next revision: no google docs.
I agree with you, even though main.lua is a filename. I think I will use an em dash (—) instead of :Santos wrote:Could "main.lua:love.load()" etc. be mistaken for Lua syntax? Probably not. Just putting that out there.
You're right. will have to update the code for that.Santos wrote:Enemies don't move completely off screen before they disappear.
josefnpat wrote:Mark for destruction, then remove later.bartbes wrote:Last thing (for now) is your use of table.remove in an ipairs loop.
Thanks Jasoco!Jasoco wrote:Because when you use table.remove, it removes the index and then goes through the entire table to move each entry after the removal point up one. Not only is it slow, but if you are running through the table in a for loop, you end up shifting all the table entry indexes and confuse the crap out of the for.Santos wrote:Could someone please explain to me why this is a good practice?
By marking them for deletion and removing them in a separate loop you avoid conflicts and slowdown.
My method is to create an empty "removal table" at the start of the update loop (Anywhere before your update loop) then while running through your table, for instance a bullet table, you A) mark the bullet as "dead" and B) add an entry to the "removal table" with that bullets index, then after you're done, you run through the "removal table" removing all items from the bullet table with that index.
Thank you very much Santos, your critique was neither subjective or "not-very-useful".
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
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: [Video Tutorial] Love Tutorial ~45min
Unless you are doing table.remove() break, which is a lot quicker and easier if you only have to remove once.Jasoco wrote:Because when you use table.remove, it removes the index and then goes through the entire table to move each entry after the removal point up one. Not only is it slow, but if you are running through the table in a for loop, you end up shifting all the table entry indexes and confuse the crap out of the for.Santos wrote:Could someone please explain to me why this is a good practice?
By marking them for deletion and removing them in a separate loop you avoid conflicts and slowdown.
My method is to create an empty "removal table" at the start of the update loop (Anywhere before your update loop) then while running through your table, for instance a bullet table, you A) mark the bullet as "dead" and B) add an entry to the "removal table" with that bullets index, then after you're done, you run through the "removal table" removing all items from the bullet table with that index.
And since no-one is going to notice a split-second delay between hitting and dying .. did I just say that out loud?
Nice tutorial .. you have a good voice for it.
Re: [Video Tutorial] Love Tutorial ~45min
I skipped around through the video and it seems like just what I need to finally get started with LÖVE. I'm eager to watch the new version with all the suggested changes.
Thanks for taking the time to make this!
Thanks for taking the time to make this!
Re: [Video Tutorial] Love Tutorial ~45min
mediafire link not working!
Who is online
Users browsing this forum: No registered users and 3 guests