

cc.Class({
    extends: cc.Component,

    properties: {
        
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        this.onDaiji();    
    },

    onDaiji: function(){
        this.node.runAction(cc.repeatForever(
            cc.sequence(
                cc.moveBy(0.4, 0, 40),
                cc.moveBy(0.4, 0, -40),
            )
        ));
        this.getComponent(cc.RigidBody).awake = true;   
    },
    
    onLauch: function(){
        let cdFunc = cc.callFunc(()=>{
            cc.HQ.GameMgr.isInitGame =true;
            this.node.setPosition(0,-325);
            this.node.rotation = 0;
            //回调
            // this.onDaiji();
        },this)

        this.node.runAction(
            // cc.sequence(
            cc.spawn(
                cc.rotateBy(0.15, 360),
                cc.moveTo(0.3, 0, 50)
            ),          
            // cdFunc
        // )
        );
    },
    
    onBeginContact: function (contact, selfCollider,otherCollider) {
        // console.log("我的刀呢");
        this.node.stopAllActions();
        // this.node.rotation = 0;
        // console.log("wwwwwww");
    }

    // update (dt) {},
});
