cc.beginPath();
cc.arc(positions[p][0].toFixed(2), positions[p][1].toFixed(2), 2, 0, Math.PI * 2, true);
cc.closePath();
cc.fillStyle = ‘red’;
cc.fill();
}
//嘴巴上
for (var p =57;p <=57;p++) {
cc.beginPath();
cc.arc(positions[p][0].toFixed(2), positions[p][1].toFixed(2), 2, 0, Math.PI * 2, true);
cc.closePath();
cc.fillStyle = ‘red’;
cc.fill();
}
//嘴巴下
for (var p =60;p <=60;p++) {
cc.beginPath();
cc.arc(positions[p][0].toFixed(2), positions[p][1].toFixed(2), 2, 0, Math.PI * 2, true);
cc.closePath();
cc.fillStyle = ‘red’;
cc.fill();
}
//////////////////////////////////////
//head
if(is_alive_head==true){
if(last_time==0 || (new Date().getTime()-last_time>500 && new Date().getTime()-last_time<10000 ) ){
var xdiff_left = positions[62][0] – positions[2][0] ;
var ydiff_left = positions[62][1] – positions[2][1] ;
var dis_left = Math.pow((xdiff_left * xdiff_left + ydiff_left * ydiff_left), 0.5);
var xdiff_right = positions[12][0] – positions[62][0] ;
var ydiff_right = positions[12][1] – positions[62][1] ;
var dis_right = Math.pow((xdiff_right * xdiff_right + ydiff_right * ydiff_right), 0.5);
var xdiff_side = positions[12][0] – positions[2][0] ;
var ydiff_side = positions[12][1] – positions[2][1] ;
var dis_side = Math.pow((xdiff_side * xdiff_side + ydiff_side * ydiff_side), 0.5);
var dis_left_right = dis_left – dis_right;
document.getElementById(‘result’).innerHTML = dis_left_right;
if(last_dis_left_right>0 && dis_left_right > dis_side/3){
document.getElementById(‘result’).innerHTML = "通过";









