Permalink
Browse files

Updates to latest cocos2d and new sounds for different platforms

  • Loading branch information...
1 parent b09877a commit 2b5beb03e8200d69e4c1514ba9f8b81cc95d1951 Viktor Lidholt committed Jan 10, 2013
Showing with 133 additions and 35 deletions.
  1. +8 −8 Published-HTML5/GameScene.js
  2. +2 −2 Published-HTML5/MainScene.js
  3. +42 −0 Published-HTML5/fileLookup.plist
  4. +18 −4 Published-HTML5/resources-html5.js
  5. BIN Published-HTML5/sounds/click.mp3
  6. BIN Published-HTML5/sounds/endgame.caf
  7. BIN Published-HTML5/sounds/endgame.mp3
  8. BIN Published-HTML5/sounds/gem-0.caf
  9. BIN Published-HTML5/sounds/gem-0.mp3
  10. BIN Published-HTML5/sounds/gem-1.caf
  11. BIN Published-HTML5/sounds/gem-1.mp3
  12. BIN Published-HTML5/sounds/gem-2.mp3
  13. BIN Published-HTML5/sounds/gem-3.mp3
  14. BIN Published-HTML5/sounds/gem-4.caf
  15. BIN Published-HTML5/sounds/gem-4.mp3
  16. BIN Published-HTML5/sounds/miss.mp3
  17. BIN Published-HTML5/sounds/powerup.mp3
  18. BIN Published-HTML5/sounds/tap-0.caf
  19. BIN Published-HTML5/sounds/tap-0.mp3
  20. BIN Published-HTML5/sounds/tap-1.caf
  21. BIN Published-HTML5/sounds/tap-1.mp3
  22. BIN Published-HTML5/sounds/tap-2.caf
  23. BIN Published-HTML5/sounds/tap-2.mp3
  24. BIN Published-HTML5/sounds/tap-3.caf
  25. BIN Published-HTML5/sounds/tap-3.mp3
  26. BIN Published-HTML5/sounds/timer.mp3
  27. +8 −8 Published-iOS/GameScene.js
  28. +2 −2 Published-iOS/MainScene.js
  29. +42 −0 Published-iOS/fileLookup.plist
  30. BIN Published-iOS/gamescene/resources-iphone/shimmer.pvr.gz
  31. BIN Published-iOS/gamescene/resources-iphonehd/shimmer.pvr.gz
  32. +1 −1 Published-iOS/main.js
  33. BIN Published-iOS/resources-iphone/crystals.pvr.gz
  34. BIN Published-iOS/resources-iphonehd/crystals.pvr.gz
  35. BIN Published-iOS/sounds/tap-2.caf
  36. BIN Published-iOS/sounds/tap-3.caf
  37. +8 −8 Resources/GameScene.js
  38. +2 −2 Resources/MainScene.js
  39. BIN Resources/sounds/click.caf
  40. BIN Published-HTML5/sounds/click.caf → Resources/sounds/click.wav
  41. BIN Resources/sounds/{endgame.caf → endgame.wav}
  42. BIN Resources/sounds/{gem-0.caf → gem-0.wav}
  43. BIN Resources/sounds/{gem-1.caf → gem-1.wav}
  44. BIN Resources/sounds/gem-2.caf
  45. BIN Published-HTML5/sounds/gem-2.caf → Resources/sounds/gem-2.wav
  46. BIN Resources/sounds/gem-3.caf
  47. BIN Published-HTML5/sounds/gem-3.caf → Resources/sounds/gem-3.wav
  48. BIN Resources/sounds/{gem-4.caf → gem-4.wav}
  49. BIN Resources/sounds/miss.caf
  50. BIN Published-HTML5/sounds/miss.caf → Resources/sounds/miss.wav
  51. BIN Resources/sounds/powerup.caf
  52. BIN Published-HTML5/sounds/powerup.caf → Resources/sounds/powerup.wav
  53. BIN Resources/sounds/{tap-0.caf → tap-0.wav}
  54. BIN Resources/sounds/{tap-1.caf → tap-1.wav}
  55. BIN Resources/sounds/tap-2.wav
  56. BIN Resources/sounds/tap-3.caf
  57. BIN Resources/sounds/{tap-2.caf → tap-3.wav}
  58. BIN Resources/sounds/timer.caf
  59. BIN Published-HTML5/sounds/timer.caf → Resources/sounds/timer.wav
@@ -198,7 +198,7 @@ function removeConnectedGems(x, y)
}
else
{
- gAudioEngine.playEffect("sounds/miss.caf");
+ gAudioEngine.playEffect("sounds/miss.wav");
}
var d = new Date();
@@ -219,7 +219,7 @@ function activatePowerUp(x, y)
if (gBoard[idx] == kBoardTypePup0)
{
// Activate bomb
- gAudioEngine.playEffect("sounds/powerup.caf");
+ gAudioEngine.playEffect("sounds/powerup.wav");
removedGems = true;
@@ -728,7 +728,7 @@ GameScene.prototype.onDidLoadFromCCB = function()
// TODO: Make into batch node
- if (cc.config.platform == "mobile")
+ if ("opengl" in sys.capabilities)
{
cc.log("On mobile");
gParticleLayer = cc.ParticleBatchNode.create("particles/taken-gem.png", 250);
@@ -786,7 +786,7 @@ GameScene.prototype.onTouchesBegan = function(touches, event)
// Player did a valid move
var sound = gNumConsecutiveGems;
if (sound > 4) sound = 4;
- gAudioEngine.playEffect("sounds/gem-"+sound+".caf");
+ gAudioEngine.playEffect("sounds/gem-"+sound+".wav");
gNumConsecutiveGems++;
}
@@ -849,7 +849,7 @@ GameScene.prototype.onUpdate = function(dt)
// The gem hit the ground or a fixed gem
if (!gemLanded)
{
- gAudioEngine.playEffect("sounds/tap-"+Math.floor(Math.random()*4)+".caf");
+ gAudioEngine.playEffect("sounds/tap-"+Math.floor(Math.random()*4)+".wav");
gemLanded = true;
}
@@ -924,7 +924,7 @@ GameScene.prototype.onUpdate = function(dt)
// Check if timer sound should be played
if (timeLeft < 6.6 && !gEndTimerStarted)
{
- gAudioEngine.playEffect("sounds/timer.caf");
+ gAudioEngine.playEffect("sounds/timer.wav");
gEndTimerStarted = true;
}
@@ -936,7 +936,7 @@ GameScene.prototype.onUpdate = function(dt)
gIsGameOver = true;
//gAudioEngine.stopAllEffects();
cc.log("stopAllEffects not working!");
- gAudioEngine.playEffect("sounds/endgame.caf");
+ gAudioEngine.playEffect("sounds/endgame.wav");
gLastScore = gScore;
}
else if (currentTime - gLastMoveTime > kDelayBeforeHint && !gIsDisplayingHint)
@@ -967,5 +967,5 @@ GameScene.prototype.onPauseClicked = function(dt)
gIsGameOver = true;
//gAudioEngine.stopAllEffects();
cc.log("stopAllEffects not working!");
- gAudioEngine.playEffect("sounds/endgame.caf");
+ gAudioEngine.playEffect("sounds/endgame.wav");
};
@@ -46,7 +46,7 @@ MainScene.prototype.onPressPlay = function()
this.menuSelection = kMenuSelectionPlay;
this.rootNode.animationManager.runAnimationsForSequenceNamed("Outro");
- gAudioEngine.playEffect("sounds/click.caf");
+ gAudioEngine.playEffect("sounds/click.wav");
// Fade out gems
for (var i = 0; i < this.fallingGems.length; i++)
@@ -59,7 +59,7 @@ MainScene.prototype.onPressPlay = function()
MainScene.prototype.onPressAbout = function()
{
- gAudioEngine.playEffect("sounds/click.caf");
+ gAudioEngine.playEffect("sounds/click.wav");
var aboutNode = cc.BuilderReader.load("AboutScene");
this.rootNode.addChild(aboutNode, 10);
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>filenames</key>
+ <dict>
+ <key>sounds/click.wav</key>
+ <string>sounds/click.mp3</string>
+ <key>sounds/endgame.wav</key>
+ <string>sounds/endgame.mp3</string>
+ <key>sounds/gem-0.wav</key>
+ <string>sounds/gem-0.mp3</string>
+ <key>sounds/gem-1.wav</key>
+ <string>sounds/gem-1.mp3</string>
+ <key>sounds/gem-2.wav</key>
+ <string>sounds/gem-2.mp3</string>
+ <key>sounds/gem-3.wav</key>
+ <string>sounds/gem-3.mp3</string>
+ <key>sounds/gem-4.wav</key>
+ <string>sounds/gem-4.mp3</string>
+ <key>sounds/miss.wav</key>
+ <string>sounds/miss.mp3</string>
+ <key>sounds/powerup.wav</key>
+ <string>sounds/powerup.mp3</string>
+ <key>sounds/tap-0.wav</key>
+ <string>sounds/tap-0.mp3</string>
+ <key>sounds/tap-1.wav</key>
+ <string>sounds/tap-1.mp3</string>
+ <key>sounds/tap-2.wav</key>
+ <string>sounds/tap-2.mp3</string>
+ <key>sounds/tap-3.wav</key>
+ <string>sounds/tap-3.mp3</string>
+ <key>sounds/timer.wav</key>
+ <string>sounds/timer.mp3</string>
+ </dict>
+ <key>metadata</key>
+ <dict>
+ <key>version</key>
+ <integer>1</integer>
+ </dict>
+</dict>
+</plist>
@@ -2,33 +2,45 @@ var ccb_resources = [
{type:'image', src:"mainscene/about-bg.png"},
{type:'plist', src:"particles/taken-vrow.plist"},
{type:'image', src:"clickme.png"},
+ {type:'sound', src:"sounds/tap-0.mp3"},
{type:'image', src:"ccbResources/ccbParticleSmoke.png"},
+ {type:'sound', src:"sounds/gem-2.mp3"},
{type:'image', src:"gamescene/btn-pause-down.png"},
- {type:'plist', src:"ccbResources/ccbDefaultImages.plist"},
+ {type:'sound', src:"sounds/endgame.mp3"},
+ {type:'sound', src:"sounds/tap-2.mp3"},
+ {type:'sound', src:"sounds/gem-4.mp3"},
{type:'image', src:"mainscene/btn-done-down.png"},
+ {type:'sound', src:"sounds/powerup.mp3"},
+ {type:'sound', src:"sounds/miss.mp3"},
{type:'image', src:"ccbResources/ccbDefaultImages.png"},
+ {type:'plist', src:"ccbResources/ccbDefaultImages.plist"},
{type:'image', src:"mainscene/btn-play.png"},
{type:'image', src:"ccbResources/ccbParticleFire.png"},
+ {type:'sound', src:"sounds/click.mp3"},
{type:'image', src:"gamescene/timer.png"},
{type:'plist', src:"particles/bg-stars.plist"},
{type:'plist', src:"particles/power-play.plist"},
{type:'image', src:"gamescene/go.png"},
{type:'image', src:"mainscene/btn-about.png"},
{type:'image', src:"mainscene/logo.png"},
- {type:'image', src:"gamescene/shimmer.png"},
+ {type:'sound', src:"sounds/gem-1.mp3"},
{type:'image', src:"mainscene/btn-play-down.png"},
{type:'plist', src:"particles/taken-hrow.plist"},
+ {type:'image', src:"gamescene/shimmer.png"},
{type:'plist', src:"particles/taken-gem.plist"},
+ {type:'sound', src:"sounds/tap-1.mp3"},
{type:'image', src:"gamescene/iPhone5-padding.png"},
{type:'image', src:"mainscene/about-fade.png"},
{type:'ccbi', src:"GameScene.ccbi"},
{type:'fnt', src:"fonts/scorefont.fnt"},
{type:'image', src:"fonts/scorefont.png"},
- {type:'plist', src:"gamescene/shimmer.plist"},
+ {type:'sound', src:"sounds/gem-3.mp3"},
+ {type:'sound', src:"sounds/tap-3.mp3"},
{type:'image', src:"mainscene/btn-done.png"},
+ {type:'plist', src:"gamescene/shimmer.plist"},
{type:'image', src:"gamescene/background.png"},
- {type:'image', src:"crystals.png"},
{type:'plist', src:"particles/falling-gem.plist"},
+ {type:'image', src:"crystals.png"},
{type:'image', src:"clickme-down.png"},
{type:'image', src:"ccbResources/ccbParticleSnow.png"},
{type:'image', src:"ccbResources/ccbParticleStars.png"},
@@ -39,4 +51,6 @@ var ccb_resources = [
{type:'image', src:"particles/taken-gem.png"},
{type:'ccbi', src:"AboutScene.ccbi"},
{type:'image', src:"mainscene/btn-about-down.png"},
+ {type:'sound', src:"sounds/gem-0.mp3"},
+ {type:'sound', src:"sounds/timer.mp3"},
];
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -198,7 +198,7 @@ function removeConnectedGems(x, y)
}
else
{
- gAudioEngine.playEffect("sounds/miss.caf");
+ gAudioEngine.playEffect("sounds/miss.wav");
}
var d = new Date();
@@ -219,7 +219,7 @@ function activatePowerUp(x, y)
if (gBoard[idx] == kBoardTypePup0)
{
// Activate bomb
- gAudioEngine.playEffect("sounds/powerup.caf");
+ gAudioEngine.playEffect("sounds/powerup.wav");
removedGems = true;
@@ -728,7 +728,7 @@ GameScene.prototype.onDidLoadFromCCB = function()
// TODO: Make into batch node
- if (cc.config.platform == "mobile")
+ if ("opengl" in sys.capabilities)
{
cc.log("On mobile");
gParticleLayer = cc.ParticleBatchNode.create("particles/taken-gem.png", 250);
@@ -786,7 +786,7 @@ GameScene.prototype.onTouchesBegan = function(touches, event)
// Player did a valid move
var sound = gNumConsecutiveGems;
if (sound > 4) sound = 4;
- gAudioEngine.playEffect("sounds/gem-"+sound+".caf");
+ gAudioEngine.playEffect("sounds/gem-"+sound+".wav");
gNumConsecutiveGems++;
}
@@ -849,7 +849,7 @@ GameScene.prototype.onUpdate = function(dt)
// The gem hit the ground or a fixed gem
if (!gemLanded)
{
- gAudioEngine.playEffect("sounds/tap-"+Math.floor(Math.random()*4)+".caf");
+ gAudioEngine.playEffect("sounds/tap-"+Math.floor(Math.random()*4)+".wav");
gemLanded = true;
}
@@ -924,7 +924,7 @@ GameScene.prototype.onUpdate = function(dt)
// Check if timer sound should be played
if (timeLeft < 6.6 && !gEndTimerStarted)
{
- gAudioEngine.playEffect("sounds/timer.caf");
+ gAudioEngine.playEffect("sounds/timer.wav");
gEndTimerStarted = true;
}
@@ -936,7 +936,7 @@ GameScene.prototype.onUpdate = function(dt)
gIsGameOver = true;
//gAudioEngine.stopAllEffects();
cc.log("stopAllEffects not working!");
- gAudioEngine.playEffect("sounds/endgame.caf");
+ gAudioEngine.playEffect("sounds/endgame.wav");
gLastScore = gScore;
}
else if (currentTime - gLastMoveTime > kDelayBeforeHint && !gIsDisplayingHint)
@@ -967,5 +967,5 @@ GameScene.prototype.onPauseClicked = function(dt)
gIsGameOver = true;
//gAudioEngine.stopAllEffects();
cc.log("stopAllEffects not working!");
- gAudioEngine.playEffect("sounds/endgame.caf");
+ gAudioEngine.playEffect("sounds/endgame.wav");
};
@@ -46,7 +46,7 @@ MainScene.prototype.onPressPlay = function()
this.menuSelection = kMenuSelectionPlay;
this.rootNode.animationManager.runAnimationsForSequenceNamed("Outro");
- gAudioEngine.playEffect("sounds/click.caf");
+ gAudioEngine.playEffect("sounds/click.wav");
// Fade out gems
for (var i = 0; i < this.fallingGems.length; i++)
@@ -59,7 +59,7 @@ MainScene.prototype.onPressPlay = function()
MainScene.prototype.onPressAbout = function()
{
- gAudioEngine.playEffect("sounds/click.caf");
+ gAudioEngine.playEffect("sounds/click.wav");
var aboutNode = cc.BuilderReader.load("AboutScene");
this.rootNode.addChild(aboutNode, 10);
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>filenames</key>
+ <dict>
+ <key>sounds/click.wav</key>
+ <string>sounds/click.caf</string>
+ <key>sounds/endgame.wav</key>
+ <string>sounds/endgame.caf</string>
+ <key>sounds/gem-0.wav</key>
+ <string>sounds/gem-0.caf</string>
+ <key>sounds/gem-1.wav</key>
+ <string>sounds/gem-1.caf</string>
+ <key>sounds/gem-2.wav</key>
+ <string>sounds/gem-2.caf</string>
+ <key>sounds/gem-3.wav</key>
+ <string>sounds/gem-3.caf</string>
+ <key>sounds/gem-4.wav</key>
+ <string>sounds/gem-4.caf</string>
+ <key>sounds/miss.wav</key>
+ <string>sounds/miss.caf</string>
+ <key>sounds/powerup.wav</key>
+ <string>sounds/powerup.caf</string>
+ <key>sounds/tap-0.wav</key>
+ <string>sounds/tap-0.caf</string>
+ <key>sounds/tap-1.wav</key>
+ <string>sounds/tap-1.caf</string>
+ <key>sounds/tap-2.wav</key>
+ <string>sounds/tap-2.caf</string>
+ <key>sounds/tap-3.wav</key>
+ <string>sounds/tap-3.caf</string>
+ <key>sounds/timer.wav</key>
+ <string>sounds/timer.caf</string>
+ </dict>
+ <key>metadata</key>
+ <dict>
+ <key>version</key>
+ <integer>1</integer>
+ </dict>
+</dict>
+</plist>
Binary file not shown.
Binary file not shown.
View
@@ -1,6 +1,6 @@
// Autogenerated main.js file
-require("jsb_constants.js");
+require("jsb.js");
require("AboutScene.js");
require("GameBoard.js");
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -198,7 +198,7 @@ function removeConnectedGems(x, y)
}
else
{
- gAudioEngine.playEffect("sounds/miss.caf");
+ gAudioEngine.playEffect("sounds/miss.wav");
}
var d = new Date();
@@ -219,7 +219,7 @@ function activatePowerUp(x, y)
if (gBoard[idx] == kBoardTypePup0)
{
// Activate bomb
- gAudioEngine.playEffect("sounds/powerup.caf");
+ gAudioEngine.playEffect("sounds/powerup.wav");
removedGems = true;
@@ -728,7 +728,7 @@ GameScene.prototype.onDidLoadFromCCB = function()
// TODO: Make into batch node
- if (cc.config.platform == "mobile")
+ if ("opengl" in sys.capabilities)
{
cc.log("On mobile");
gParticleLayer = cc.ParticleBatchNode.create("particles/taken-gem.png", 250);
@@ -786,7 +786,7 @@ GameScene.prototype.onTouchesBegan = function(touches, event)
// Player did a valid move
var sound = gNumConsecutiveGems;
if (sound > 4) sound = 4;
- gAudioEngine.playEffect("sounds/gem-"+sound+".caf");
+ gAudioEngine.playEffect("sounds/gem-"+sound+".wav");
gNumConsecutiveGems++;
}
@@ -849,7 +849,7 @@ GameScene.prototype.onUpdate = function(dt)
// The gem hit the ground or a fixed gem
if (!gemLanded)
{
- gAudioEngine.playEffect("sounds/tap-"+Math.floor(Math.random()*4)+".caf");
+ gAudioEngine.playEffect("sounds/tap-"+Math.floor(Math.random()*4)+".wav");
gemLanded = true;
}
@@ -924,7 +924,7 @@ GameScene.prototype.onUpdate = function(dt)
// Check if timer sound should be played
if (timeLeft < 6.6 && !gEndTimerStarted)
{
- gAudioEngine.playEffect("sounds/timer.caf");
+ gAudioEngine.playEffect("sounds/timer.wav");
gEndTimerStarted = true;
}
@@ -936,7 +936,7 @@ GameScene.prototype.onUpdate = function(dt)
gIsGameOver = true;
//gAudioEngine.stopAllEffects();
cc.log("stopAllEffects not working!");
- gAudioEngine.playEffect("sounds/endgame.caf");
+ gAudioEngine.playEffect("sounds/endgame.wav");
gLastScore = gScore;
}
else if (currentTime - gLastMoveTime > kDelayBeforeHint && !gIsDisplayingHint)
@@ -967,5 +967,5 @@ GameScene.prototype.onPauseClicked = function(dt)
gIsGameOver = true;
//gAudioEngine.stopAllEffects();
cc.log("stopAllEffects not working!");
- gAudioEngine.playEffect("sounds/endgame.caf");
+ gAudioEngine.playEffect("sounds/endgame.wav");
};
Oops, something went wrong.

0 comments on commit 2b5beb0

Please sign in to comment.