Explosion and picking sounds
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
window.Images = new ImageLoader();
|
window.Images = new ImageLoader();
|
||||||
|
window.Sounds = new SoundLoader();
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
@@ -69,6 +69,7 @@ CandyEntity.prototype = {
|
|||||||
this.Game.GameScreen.AddEntity(frag);
|
this.Game.GameScreen.AddEntity(frag);
|
||||||
}
|
}
|
||||||
this.GameEntity.Delete();
|
this.GameEntity.Delete();
|
||||||
|
window.Sounds.PlaySound("Explosion");
|
||||||
},
|
},
|
||||||
SetOffset: function(x, y){
|
SetOffset: function(x, y){
|
||||||
this.GameEntity.UpdatePosition({
|
this.GameEntity.UpdatePosition({
|
||||||
@@ -112,21 +113,38 @@ var CandyFucker = function(idScreen, idInfoDisplay){
|
|||||||
|
|
||||||
this.MaxSwapDistance = 32;
|
this.MaxSwapDistance = 32;
|
||||||
|
|
||||||
window.Images.LoadImages(
|
this.LoadImages();
|
||||||
[
|
|
||||||
{Name: "Red", Url: "gfx/Red.png"},
|
|
||||||
{Name: "Blue", Url: "gfx/Blue.png"},
|
|
||||||
{Name: "Cyan", Url: "gfx/Cyan.png"},
|
|
||||||
{Name: "Green", Url: "gfx/Green.png"},
|
|
||||||
{Name: "Yellow", Url: "gfx/Yellow.png"},
|
|
||||||
],
|
|
||||||
function(){
|
|
||||||
self.GameScreen.Start();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
CandyFucker.prototype = {
|
CandyFucker.prototype = {
|
||||||
|
LoadImages: function(){
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
window.Images.LoadImages(
|
||||||
|
[
|
||||||
|
{Name: "Red", Url: "gfx/Red.png"},
|
||||||
|
{Name: "Blue", Url: "gfx/Blue.png"},
|
||||||
|
{Name: "Cyan", Url: "gfx/Cyan.png"},
|
||||||
|
{Name: "Green", Url: "gfx/Green.png"},
|
||||||
|
{Name: "Yellow", Url: "gfx/Yellow.png"},
|
||||||
|
],
|
||||||
|
function(){
|
||||||
|
self.LoadSounds();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
LoadSounds: function(){
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
window.Sounds.LoadSounds(
|
||||||
|
[
|
||||||
|
{Name: "Explosion", Url: "sfx/explosion1.wav"},
|
||||||
|
{Name: "PickCandy", Url: "sfx/pickcandy.wav"},
|
||||||
|
],
|
||||||
|
function(){
|
||||||
|
self.GameScreen.Start();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
Init: function(gameScreen){
|
Init: function(gameScreen){
|
||||||
this.BuildGrid(12, 12);
|
this.BuildGrid(12, 12);
|
||||||
this.UpdateInfoDisplay();
|
this.UpdateInfoDisplay();
|
||||||
@@ -380,6 +398,7 @@ CandyFucker.prototype = {
|
|||||||
this.CancelSwap();
|
this.CancelSwap();
|
||||||
}else{
|
}else{
|
||||||
this.StartSwap(candies[0]);
|
this.StartSwap(candies[0]);
|
||||||
|
window.Sounds.PlaySound("PickCandy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.SwapDirection!=null){
|
if(this.SwapDirection!=null){
|
||||||
|
|||||||
BIN
sfx/explosion1.wav
Normal file
BIN
sfx/explosion1.wav
Normal file
Binary file not shown.
BIN
sfx/pickcandy.wav
Normal file
BIN
sfx/pickcandy.wav
Normal file
Binary file not shown.
Reference in New Issue
Block a user