37 lines
510 B
JavaScript
37 lines
510 B
JavaScript
Game = function(){//构造方法
|
|
this.score = 0;//当前游戏积分
|
|
this.mode = -1;
|
|
//this.highscore = 0;
|
|
}
|
|
if(typeof(Game.prototype.newgame) == "undefined"){
|
|
Game.prototype.newgame = function(mode){//获得方格
|
|
switch(mode){
|
|
case 0:
|
|
this.mode = mode;
|
|
utlnewgame(mode);
|
|
g_player.entergame(0);
|
|
break;
|
|
}
|
|
};
|
|
}
|
|
|
|
Game.prototype.leavegame = function(mode){
|
|
switch(mode){
|
|
case 0:
|
|
this.mode = mode;
|
|
utlnewgame(mode);
|
|
g_player.entergame(0);
|
|
break;
|
|
}
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|