来源:flash,as,js兴趣爱好者html5 canvas动画之雷切,flash闪电特效,flash闪电素材
可能需要加载一会。
html5 canvas动画之雷切,flash闪电特效,flash闪电素材
主场景
this.action_="walk";
var action_speed=2;
var action_walk=0;
//this.gebo_.left_down.leiqie_.visible=false;
this.gebo2.left_down.leiqie_.visible=false;
if(this.action_=="walk"){
this.addEventListener("tick",fl_RotateContinuously.bind(this));
}
function fl_RotateContinuously(){
if(action_walk==0){
this.gebo_.rotation+=1*action_speed;
this.lefttui.rotation+=1*action_speed;
this.gebo2.rotation-=1*action_speed;
this.righttui.rotation-=1*action_speed;
}else{
this.gebo_.rotation-=1*action_speed;
this.lefttui.rotation-=1*action_speed;
this.gebo2.rotation+=1*action_speed;
this.righttui.rotation+=1*action_speed;
}
if(this.lefttui.rotation<=-40){
action_walk=0;
}else if(this.lefttui.rotation>=30){
action_walk=1;
}
}
胳膊
var action_speed=2;
var action_walk=0;
if(this.parent.action_=="walk"){
this.addEventListener("tick",fl_RotateContinuously.bind(this));
}
function fl_RotateContinuously(){
if(action_walk==0){
this.left_down.rotation-=1*action_speed;
}else{
this.left_down.rotation+=1*action_speed;
}
if(this.left_down.rotation>=0){
action_walk=0;
}else if(this.left_down.rotation<=-40){
action_walk=1;
}
}
html5 canvas动画之雷切,flash闪电特效,flash闪电素材