战棋模式改进
This commit is contained in:
parent
b604b39e4d
commit
d50db52f9a
42
game/game.js
42
game/game.js
|
@ -4259,16 +4259,46 @@
|
|||
if(list.length) this.$draw(list);
|
||||
},
|
||||
$fire:function(){
|
||||
game.animate.flame(this.offsetLeft+this.offsetWidth/2,
|
||||
this.offsetTop+this.offsetHeight-20,700,'fire');
|
||||
var left,top;
|
||||
if(lib.config.mode=='chess'){
|
||||
var rect=this.getBoundingClientRect();
|
||||
left=rect.left;
|
||||
top=rect.top;
|
||||
}
|
||||
else{
|
||||
left=this.offsetLeft;
|
||||
top=this.offsetTop;
|
||||
}
|
||||
game.animate.flame(left+this.offsetWidth/2,
|
||||
top+this.offsetHeight-20,700,'fire');
|
||||
},
|
||||
$thunder:function(){
|
||||
game.animate.flame(this.offsetLeft+this.offsetWidth/2,
|
||||
this.offsetTop+this.offsetHeight-30,700,'thunder');
|
||||
var left,top;
|
||||
if(lib.config.mode=='chess'){
|
||||
var rect=this.getBoundingClientRect();
|
||||
left=rect.left;
|
||||
top=rect.top;
|
||||
}
|
||||
else{
|
||||
left=this.offsetLeft;
|
||||
top=this.offsetTop;
|
||||
}
|
||||
game.animate.flame(left+this.offsetWidth/2,
|
||||
top+this.offsetHeight-30,700,'thunder');
|
||||
},
|
||||
$recover:function(){
|
||||
game.animate.flame(this.offsetLeft+this.offsetWidth/2,
|
||||
this.offsetTop+this.offsetHeight-30,700,'recover');
|
||||
var left,top;
|
||||
if(lib.config.mode=='chess'){
|
||||
var rect=this.getBoundingClientRect();
|
||||
left=rect.left;
|
||||
top=rect.top;
|
||||
}
|
||||
else{
|
||||
left=this.offsetLeft;
|
||||
top=this.offsetTop;
|
||||
}
|
||||
game.animate.flame(left+this.offsetWidth/2,
|
||||
top+this.offsetHeight-30,700,'recover');
|
||||
},
|
||||
$damagepop:function(num,nature){
|
||||
if(typeof num=='number'){
|
||||
|
|
|
@ -217,6 +217,7 @@ margin-bottom: 5px;
|
|||
width: 100%;
|
||||
text-align: center;
|
||||
top:calc(50% - 36px);
|
||||
left:0;
|
||||
opacity: 0;
|
||||
-webkit-transform:scale(0.7);
|
||||
}
|
||||
|
|
|
@ -28,6 +28,11 @@
|
|||
#arena .card.thrown{
|
||||
z-index:4;
|
||||
}
|
||||
#canvas2{
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#handcards1{
|
||||
height:120px;
|
||||
|
|
|
@ -624,6 +624,7 @@ mode.chess={
|
|||
ui.chessContainer.style.WebkitOverflowScrolling='touch';
|
||||
ui.chess=ui.create.div('#chess',ui.chessContainer);
|
||||
ui.canvas2=document.createElement('canvas');
|
||||
ui.canvas2.id='canvas2';
|
||||
ui.chess.appendChild(ui.canvas2);
|
||||
ui.ctx2=ui.canvas2.getContext('2d');
|
||||
game.me=ui.create.player();
|
||||
|
|
Loading…
Reference in New Issue