Help with audio
Posted: Wed Mar 17, 2010 4:39 am
I am trying to implement sound in my first pong game named pongZ. Anyways, this error always occur when i run my game. An attempt to index 'audio' blah blah blah. Now this is what i added to my main.lua files.
I try this lines in a seperate .love file and it work but when i put into my own game, there is an error. Here is the pongz.love if anybody wants to take a look. btw, i am new to game dev/design so thank you for taking the time to help me. Thanks.
Code: Select all
-- Sound 1 is when ball hit wall
hitWallSound = love.audio.newSource("sounds/hitwall.wav")
-- Sound 2 is when ball hit paddle
hitPaddleSound = love.audio.newSource("sounds/hitpaddle.wav")
-- Sound 3 is when new ball is spawned
newBallSound = love.audio.newSource("sounds/newball.wav")