Page 454 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 454
var _this = this;
$("#selectCupMenuDiv").toggle("slide", function() {
_this.canRaiseCups = true;
});
};
Game.prototype.guess = function(cupHasBall) {
var _this = this;
this.canRaiseCups = false;
var self = this;
$("#selectCupMenuDiv").toggle("slide", function() {
if (cupHasBall) {
$("#successMenuDiv").toggle("slide");
_this.updateBank(true);
_this.increaseLevel();
} else {
swal({
title : "You Lose!",
//text : "",
type : "error",
showConfirmButton : false,
},setTimeout(function(){
location.href = "/"
}, 2000)
);
}
for (var i = 0; i < self.cupCollection.length; i++) {
if (!self.cupCollection[i].Selected) {
self.cupCollection[i].raiseCup();
}
self.cupCollection[i].Selected = false;
}
}).click();
};
Game.prototype.updateBank = function(succeeded) {
if (succeeded) {
if(setlevel == 20){
this.cashInBank += this.bet * 3;
}
- 447 -