// 角色静态数据 总血量 总级别 每个级别属性

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 () {},

    start () {

    },

    onCollisionEnter: function (other, self) {
        //动画
        this.node.parent.getComponent('GameMode').shakeEffect()
        cc.audioEngine.play(this.node.parent.getComponent('GameMode').sound[3],false)
        var enemyAnimation = cc.instantiate(this.node.parent.getComponent('GameMode').Animation[6])
        enemyAnimation.parent = this.node.parent
        enemyAnimation.position = this.node.position
        this.node.runAction(cc.sequence(cc.tintTo(0.1,255,0,0),cc.tintTo(0.1,255,255,255)))
        this.node.parent.getComponent('GameMode').loseLife()
    }
    // update (dt) {},
});
