games50 / breakout

Remake of the classic Atari game Breakout!
35 stars 82 forks source link

Line 73, love.audio.newSource "string expected" #2

Closed 09jlardinois closed 6 years ago

09jlardinois commented 6 years ago

Hi, the direct source code is throwing an error on line 73. It says "bad argument, string expected, got no value", but clearly paddle_hit.wav is defined. The file exists, all is well.

But the error?

09jlardinois commented 6 years ago

Solved it.

The newSource('folder/sound.wav') should be newSource('folder/sound.wav', 'static / stream / queue')

I hope that makes sense... yikes if it doesn't. So, line 73 in particular should read,

['paddle-hit'] = love.audio.newSource('sounds/paddle_hit.wav', 'static'),

Because newSource takes a file name and sound type (not to be confused with data type). Types in Love2D 11.1 are static, stream, and queue. I'll leave it up to the confused users to figure out what all that is themselves.

girng commented 4 years ago

I'll leave it up to the confused users to figure out what all that is themselves.

LOL

girng commented 4 years ago

https://love2d.org/wiki/Tutorial:Audio should be updated as well