Search found 118 matches
- Wed Oct 13, 2010 2:37 am
- Forum: Support and Development
- Topic: Question about love.audio.rewind()
- Replies: 14
- Views: 3428
Re: Question about love.audio.rewind()
This thread's gotten a bit off-topic. Bringing it back: The problem I ran into at first was that this would only successfully play once every couple of seconds or so. This is a known bug with LÖVE's WAV decoding, unfortunately. The easiest way to avoid that lag is to use a different audio format (m...
- Wed Oct 13, 2010 1:22 am
- Forum: General
- Topic: Lua question: Is it possible to get the key from a table...
- Replies: 3
- Views: 1519
Re: Lua question: Is it possible to get the key from a table
I actually just finished writing exactly that helper function, but I suppose I wondered if there was a built-in function. I believe this answers my question nonetheless :] Thank you Anjoanjo wrote:Code: Select all
function findValueInTable(value, t) for k,v in pairs(t) do if v == value then return k end end end
- Wed Oct 13, 2010 1:16 am
- Forum: General
- Topic: Lua question: Is it possible to get the key from a table...
- Replies: 3
- Views: 1519
Lua question: Is it possible to get the key from a table...
Is it possible to search a table by value and return the first key with a matching value?
- Tue Oct 12, 2010 9:11 pm
- Forum: Games and Creations
- Topic: My first project, advice and tips welcome!
- Replies: 24
- Views: 10352
Re: My first project, advice and tips welcome!
Nice. Very impressive for a first project in LÖVE. :) The explosion clouds stay on screen a bit long, though. And I exploded once but could go on afterwards, is that expected behaviour? Thank you and thank you for trying it out :) I'm actually experimenting with fading the clouds out slowly by chan...
- Tue Oct 12, 2010 2:17 pm
- Forum: Games and Creations
- Topic: My first project, advice and tips welcome!
- Replies: 24
- Views: 10352
Re: My first project, advice and tips welcome!
Good work ninwa. You posted the update right before I was about to sleep :P so I'll play it more tomorrow. Am I suppsed to be able to hold down space for INFINITE LAZ0RZ though? For now yeah, but in the future different projectiles types will have different firing rates. I've been kind of adding a ...
- Tue Oct 12, 2010 2:05 pm
- Forum: Games and Creations
- Topic: My first project, advice and tips welcome!
- Replies: 24
- Views: 10352
Re: My first project, advice and tips welcome!
Can anyone re-rail this thread back on track? Thanks Please and thank you, I'll try. Minor update: Added sound effects Added scoring Changed the waves around Changed all table lookups from x["y"] style to x.y style. Download: http://www.josephbleau.com/SpaceScout_v0-4.love
- Tue Oct 12, 2010 1:03 pm
- Forum: Support and Development
- Topic: Question about love.audio.rewind()
- Replies: 14
- Views: 3428
Re: Question about love.audio.rewind()
Not that I know what that piece of code does, but I suspect it turns off the garbage collector - which certainly wouldn't be a solution. The reason the game crashed now, I suspect, is because your sound source is being cleaned up by the garbage collector after your function has been run - before it...
- Tue Oct 12, 2010 12:31 pm
- Forum: Support and Development
- Topic: Question about love.audio.rewind()
- Replies: 14
- Views: 3428
Re: Question about love.audio.rewind()
My simple "for now" solution: function playSFX(file) local sfx = love.audio.newSource(file) love.audio.play(sfx) end Note: I only use this for one-off sound effects, not for the background music. Bad, bad idea! What will happen once you've played 1000 sounds? EDIT: Hmm, or maybe the garba...
- Tue Oct 12, 2010 12:26 pm
- Forum: Support and Development
- Topic: Question about love.audio.rewind()
- Replies: 14
- Views: 3428
Re: Question about love.audio.rewind()
My simple "for now" solution:
Note: I only use this for one-off sound effects, not for the background music.
Code: Select all
function playSFX(file)
local sfx = love.audio.newSource(file)
love.audio.play(sfx)
end
- Tue Oct 12, 2010 12:21 pm
- Forum: Support and Development
- Topic: Question about love.audio.rewind()
- Replies: 14
- Views: 3428
Re: Question about love.audio.rewind()
What am I doing wrong? Think of sources as... Well, sources. A trumpet, for example. A trumpet can only make one sound at a time. You can't have one trumpeteer (I may just have made that word up) play two notes at the same time. The same goes for sound sources. Once you've played a sound source, yo...