mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6913 from samuele3hu/v3_fix
Update lua-template and lua-empty-test for replacing bgMusicPath
This commit is contained in:
commit
592831b8fb
|
@ -205,15 +205,7 @@ local function main()
|
|||
end
|
||||
|
||||
-- play background music, preload effect
|
||||
|
||||
-- uncomment below for the BlackBerry version
|
||||
local bgMusicPath = nil
|
||||
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then
|
||||
bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.caf")
|
||||
else
|
||||
bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3")
|
||||
end
|
||||
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
|
||||
cc.SimpleAudioEngine:getInstance():playMusic("res/background.mp3", true)
|
||||
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav")
|
||||
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)
|
||||
|
||||
|
|
|
@ -206,15 +206,7 @@ local function main()
|
|||
end
|
||||
|
||||
-- play background music, preload effect
|
||||
|
||||
-- uncomment below for the BlackBerry version
|
||||
local bgMusicPath = nil
|
||||
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then
|
||||
bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.caf")
|
||||
else
|
||||
bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3")
|
||||
end
|
||||
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
|
||||
cc.SimpleAudioEngine:getInstance():playMusic("res/background.mp3", true)
|
||||
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav")
|
||||
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)
|
||||
|
||||
|
|
|
@ -193,16 +193,7 @@ local function main()
|
|||
end
|
||||
|
||||
-- play background music, preload effect
|
||||
|
||||
-- uncomment below for the BlackBerry version
|
||||
local bgMusicPath = nil
|
||||
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then
|
||||
bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.caf")
|
||||
else
|
||||
bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3")
|
||||
end
|
||||
|
||||
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
|
||||
cc.SimpleAudioEngine:getInstance():playMusic("res/background.mp3", true)
|
||||
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("res/effect1.wav")
|
||||
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)
|
||||
|
||||
|
|
Loading…
Reference in New Issue