flash canvas-火影忍者佐助出招

liujieheng 2014-02-01

来源:flash,as,js兴趣爱好者flash canvas-火影忍者佐助出招     flash canvas-火影忍者佐助出招
    

flash技术网,html5技术网


    

查看演示


    
    this.action_="leiqie";
    var action_speed=10;
    var action_walk=0;
    this.leiqie_.visible=false;
    var shentix=this.shenti_.x;
    //this.gebo_.left_down.leiqie_.visible=false;
    //this.gebo2.left_down.leiqie_.visible=false;
    if(this.action_=="walk"){
    this.addEventListener("tick",walk_loop.bind(this));
    }else if(this.action_=="leiqie"){
    var leiqie_buf=new lib.leiqie();
    this.shenti_.body_.leftgebo.down.wuqi_.addChild(leiqie_buf);
    leiqie_buf.x=-200;
    leiqie_buf.y=-213;
    this.setChildIndex(leiqie_buf,-10);
    this.shenti_.body_.leftgebo.rotation=90;
    this.shenti_.body_.leftgebo.down.rotation=-150;
    this.shenti_.body_.rightgebo.rotation=-20;
    this.shenti_.body_.rightgebo.down.rotation=-70;
    this.shenti_.lefttui.rotation=-40;
    this.shenti_.lefttui.down.rotation=40;
    this.shenti_.righttui.rotation=20;
    this.shenti_.righttui.down.rotation=20;
    this.addEventListener("tick",leiqie_loop.bind(this));
    }
    function leiqie_loop(){
    if(this.shenti_.body_.leftgebo.rotation>-105){
    this.shenti_.body_.rightgebo.rotation+=action_speed*1.4;
    this.shenti_.body_.rightgebo.down.rotation-=action_speed/2;
    this.shenti_.body_.leftgebo.rotation-=action_speed*5;
    this.shenti_.body_.leftgebo.down.rotation+=action_speed*4;
    this.shenti_.x+=action_speed*1;
    this.shenti_.body_.head_.rotation-=action_speed;
    this.shenti_.body_.rotation+=action_speed/1.5;
    this.shenti_.righttui.rotation+=action_speed/4;
    //this.lefttui.left_leg_down_.rotation+=action_speed/2;
    this.shenti_.lefttui.rotation-=action_speed/1.5;
    this.shenti_.lefttui.down.rotation+=action_speed/1.5;
    
    }else{
    if(Math.abs(this.shenti_.x-shentix)<400){
    this.shenti_.x+=action_speed*10;
    }else{
    this.removeEventListener("tick",leiqie_loop.bind(this));
    }
    
    }
    }
    function walk_loop(){
    if(action_walk==0){
    this.shenti_.body_.leftgebo.rotation+=1*action_speed;
    this.shenti_.lefttui.rotation+=1*action_speed;
    this.shenti_.body_.rightgebo.rotation-=1*action_speed;
    this.shenti_.righttui.rotation-=1*action_speed;
    }else{
    this.shenti_.body_.leftgebo.rotation-=1*action_speed;
    this.shenti_.lefttui.rotation-=1*action_speed;
    this.shenti_.body_.rightgebo.rotation+=1*action_speed;
    this.shenti_.righttui.rotation+=1*action_speed;
    }
    if(this.shenti_.lefttui.rotation<=-40){
    action_walk=0;
    }else if(this.shenti_.lefttui.rotation>=30){
    action_walk=1;
    }
    }
    flash canvas-火影忍者佐助出招

Global site tag (gtag.js) - Google Analytics