crazyhouse piece drop sound
This commit is contained in:
parent
9e0d694fc4
commit
461bd661fe
|
@ -73,7 +73,11 @@ module.exports = function(opts) {
|
|||
} else sound.move();
|
||||
}.bind(this);
|
||||
|
||||
this.chessground = ground.make(this.data, this.vm.ply, onUserMove, onUserNewPiece, onMove);
|
||||
var onNewPiece = function(piece, pos) {
|
||||
sound.move();
|
||||
}.bind(this);
|
||||
|
||||
this.chessground = ground.make(this.data, this.vm.ply, onUserMove, onUserNewPiece, onMove, onNewPiece);
|
||||
|
||||
this.replaying = function() {
|
||||
return this.vm.ply !== round.lastPly(this.data);
|
||||
|
|
|
@ -60,14 +60,15 @@ function makeConfig(data, ply, flip) {
|
|||
};
|
||||
}
|
||||
|
||||
function make(data, ply, userMove, userNewPiece, onMove) {
|
||||
function make(data, ply, userMove, userNewPiece, onMove, onNewPiece) {
|
||||
var config = makeConfig(data, ply);
|
||||
config.movable.events = {
|
||||
after: userMove,
|
||||
afterNewPiece: userNewPiece
|
||||
};
|
||||
config.events = {
|
||||
move: onMove
|
||||
move: onMove,
|
||||
dropNewPiece: onNewPiece
|
||||
};
|
||||
config.viewOnly = data.player.spectator;
|
||||
return new chessground.controller(config);
|
||||
|
|
Loading…
Reference in a new issue