Update lua-template and lua-empty-test for replacing bgMusicPath

This commit is contained in:
samuele3hu 2014-05-28 10:27:03 +08:00
Родитель c52132179a
Коммит 90cac02de6
3 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -205,7 +205,8 @@ local function main()
end
-- play background music, preload effect
cc.SimpleAudioEngine:getInstance():playMusic("res/background.mp3", true)
local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("background.mp3")
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav")
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)

Просмотреть файл

@ -206,7 +206,10 @@ local function main()
end
-- play background music, preload effect
cc.SimpleAudioEngine:getInstance():playMusic("res/background.mp3", true)
-- uncomment below for the BlackBerry version
local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("background.mp3")
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav")
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)

Просмотреть файл

@ -193,7 +193,8 @@ local function main()
end
-- play background music, preload effect
cc.SimpleAudioEngine:getInstance():playMusic("res/background.mp3", true)
local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3")
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("res/effect1.wav")
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)