Skip to content

Commit

Permalink
Remove unnecessary stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Aug 16, 2015
1 parent bdf9b4a commit 43ecea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions module/sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ var pachiSounds = Object.keys(new Int8Array(5)).map(function(x) {
var newGameSound = new Audio('../sound/newgame.wav')
var passSound = new Audio('../sound/pass.wav')

exports.playCaptureSound = function() {
exports.playCapture = function() {
captureSounds[Math.floor(Math.random() * 5)].play()
}

exports.playPachiSound = function() {
exports.playPachi = function() {
pachiSounds[Math.floor(Math.random() * 5)].play()
}

exports.playNewGameSound = function() { newGameSound.play() }
exports.playPassSound = function() { passSound.play() }
exports.playNewGame = function() { newGameSound.play() }
exports.playPass = function() { passSound.play() }
9 changes: 4 additions & 5 deletions view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var shell = require('shell')
var sgf = require('../module/sgf')
var gametree = require('../module/gametree')
var sound = require('../module/sound')
var uuid = require('../lib/node-uuid')
var process = remote.require('process')
var app = remote.require('app')
var dialog = remote.require('dialog')
Expand Down Expand Up @@ -440,11 +439,11 @@ function makeMove(vertex) {

// Play sounds
if (capture || suicide) setTimeout(function() {
sound.playCaptureSound()
sound.playCapture()
}, 300 + Math.floor(Math.random() * 200))

sound.playPachiSound()
} else sound.playPassSound()
sound.playPachi()
} else sound.playPass()


if (tree.current == null && tree.nodes.length - 1 == index) {
Expand Down Expand Up @@ -779,7 +778,7 @@ function newGame(playSound) {
setRootTree(tree)

if (arguments.length >= 1 && playSound) {
sound.playNewGameSound()
sound.playNewGame()
showGameInfo()
}

Expand Down

0 comments on commit 43ecea0

Please sign in to comment.