Skip to content

Commit

Permalink
Updates to latest cocos2d and new sounds for different platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Lidholt committed Jan 10, 2013
1 parent b09877a commit 2b5beb0
Show file tree
Hide file tree
Showing 59 changed files with 133 additions and 35 deletions.
16 changes: 8 additions & 8 deletions Published-HTML5/GameScene.js
Expand Up @@ -198,7 +198,7 @@ function removeConnectedGems(x, y)
}
else
{
gAudioEngine.playEffect("sounds/miss.caf");
gAudioEngine.playEffect("sounds/miss.wav");
}

var d = new Date();
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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)
Expand Down Expand Up @@ -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");
};
4 changes: 2 additions & 2 deletions Published-HTML5/MainScene.js
Expand Up @@ -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++)
Expand All @@ -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);
Expand Down
42 changes: 42 additions & 0 deletions Published-HTML5/fileLookup.plist
@@ -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>
22 changes: 18 additions & 4 deletions Published-HTML5/resources-html5.js
Expand Up @@ -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"},
Expand All @@ -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 added Published-HTML5/sounds/click.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/endgame.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/endgame.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/gem-0.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/gem-0.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/gem-1.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/gem-1.mp3
Binary file not shown.
Binary file added Published-HTML5/sounds/gem-2.mp3
Binary file not shown.
Binary file added Published-HTML5/sounds/gem-3.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/gem-4.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/gem-4.mp3
Binary file not shown.
Binary file added Published-HTML5/sounds/miss.mp3
Binary file not shown.
Binary file added Published-HTML5/sounds/powerup.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/tap-0.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/tap-0.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/tap-1.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/tap-1.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/tap-2.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/tap-2.mp3
Binary file not shown.
Binary file removed Published-HTML5/sounds/tap-3.caf
Binary file not shown.
Binary file added Published-HTML5/sounds/tap-3.mp3
Binary file not shown.
Binary file added Published-HTML5/sounds/timer.mp3
Binary file not shown.
16 changes: 8 additions & 8 deletions Published-iOS/GameScene.js
Expand Up @@ -198,7 +198,7 @@ function removeConnectedGems(x, y)
}
else
{
gAudioEngine.playEffect("sounds/miss.caf");
gAudioEngine.playEffect("sounds/miss.wav");
}

var d = new Date();
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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)
Expand Down Expand Up @@ -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");
};
4 changes: 2 additions & 2 deletions Published-iOS/MainScene.js
Expand Up @@ -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++)
Expand All @@ -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);
Expand Down
42 changes: 42 additions & 0 deletions Published-iOS/fileLookup.plist
@@ -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 modified Published-iOS/gamescene/resources-iphone/shimmer.pvr.gz
Binary file not shown.
Binary file modified Published-iOS/gamescene/resources-iphonehd/shimmer.pvr.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion Published-iOS/main.js
@@ -1,6 +1,6 @@
// Autogenerated main.js file

require("jsb_constants.js");
require("jsb.js");

require("AboutScene.js");
require("GameBoard.js");
Expand Down
Binary file modified Published-iOS/resources-iphone/crystals.pvr.gz
Binary file not shown.
Binary file modified Published-iOS/resources-iphonehd/crystals.pvr.gz
Binary file not shown.
Binary file modified Published-iOS/sounds/tap-2.caf
Binary file not shown.
Binary file modified Published-iOS/sounds/tap-3.caf
Binary file not shown.
16 changes: 8 additions & 8 deletions Resources/GameScene.js
Expand Up @@ -198,7 +198,7 @@ function removeConnectedGems(x, y)
}
else
{
gAudioEngine.playEffect("sounds/miss.caf");
gAudioEngine.playEffect("sounds/miss.wav");
}

var d = new Date();
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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)
Expand Down Expand Up @@ -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");
};

0 comments on commit 2b5beb0

Please sign in to comment.