生命计数修改为2

This commit is contained in:
mumuy 2016-04-21 20:52:33 +08:00
parent 4ad93dd91b
commit 5f6c155b3a

View File

@ -287,7 +287,7 @@
width:30, width:30,
height:30, height:30,
draw:function(context){ draw:function(context){
for(var i=0;i<_LIFE;i++){ for(var i=0;i<_LIFE-1;i++){
var x=this.x+36*i,y=this.y; var x=this.x+36*i,y=this.y;
context.fillStyle = '#FFE600'; context.fillStyle = '#FFE600';
context.beginPath(); context.beginPath();
@ -314,7 +314,7 @@
if(typeof this.control.orientation!='undefined'){ if(typeof this.control.orientation!='undefined'){
if(!map.get(coord.x+_COS[this.control.orientation],coord.y+_SIN[this.control.orientation])){ if(!map.get(coord.x+_COS[this.control.orientation],coord.y+_SIN[this.control.orientation])){
this.orientation = this.control.orientation; this.orientation = this.control.orientation;
} }
} }
this.control = {}; this.control = {};
var value = map.get(coord.x+_COS[this.orientation],coord.y+_SIN[this.orientation]); var value = map.get(coord.x+_COS[this.orientation],coord.y+_SIN[this.orientation]);
@ -409,7 +409,7 @@
}, },
draw:function(context){ draw:function(context){
context.fillStyle = this.color; context.fillStyle = this.color;
context.beginPath(); context.beginPath();
context.arc(this.x,this.y,this.width*.5,0,Math.PI,true); context.arc(this.x,this.y,this.width*.5,0,Math.PI,true);
switch(this.times%2){ switch(this.times%2){
case 0: case 0:
@ -504,4 +504,4 @@
}); });
})(); })();
game.init(); game.init();
})(); })();