Error
main.lua:5: attempt to index global 'a' (a boolean value)
Traceback
[love "callbacks.lua"]:228: in function 'handler'
main.lua:5: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'
Here's my code:
Code: Select all
--main
a = require("Audio")
function love.load()
a:load()
end
function love.update(dt)
a:update(dt)
end
Code: Select all
--Audio
function load()
source = love.audio.newSource( "Backgroundsong.wav", "stream" )
end
function update(dt)
if not source:isPlaying( ) then
love.audio.play( source )
end
end