I plan on using LÖVE for the main logic, graphics and audio.
Now, I have some programming experience but it's pretty limited. Especially since it's been years since I've done programming of any sort. I started experimenting with LÖVE and yesterday ran into my first real obstacle and I hope you can tell me what I'm doing wrong.
I 'stole' some code from an example I found on this forum that (amongst other things) handles keypresses. The unmodified program works perfectly. When I add the following code to the "if key=="X" then" part:
Code: Select all
sfx = love.audio.newSource("sfx.wav", "static")
love.audio.play(sfx)
However, after a few times LÖVE completely crashes. I tried taking the first line out of the keypress event, but that only made things worse. What am I doing wrong?
I'd love to hear your opinions.
I found the code I use to play the sounds here: http://love2d.org/wiki/love.audio.newSource