// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //     // ATTRIBUTES:
        //     default: null,        // The default value will be used only when the component attaching
        //                           // to a node for the first time
        //     type: cc.SpriteFrame, // optional, default is typeof default
        //     serializable: true,   // optional, default is true
        // },
        // bar: {
        //     get () {
        //         return this._bar;
        //     },
        //     set (value) {
        //         this._bar = value;
        //     }
        // },
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        let item = this.node;
        // alert("抖动效果");
        // let tween = cc.tween(item);
        // tween.to(0.06, { angle: 10 })
        //     .to(0.06, { angle: 0 })
        //     .to(0.06, { angle: -10 })
        //     .to(0.06, { angle: 0 });
        // tween.repeat(100);
        // tween.start();
        let ani = cc.repeatForever(cc.sequence(cc.moveBy(0.5, cc.v2(0, 25)), cc.moveBy(0.5, cc.v2(0, -25))));
        item.runAction(ani);
    },

    start() {

    },

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