// 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;
        //     }
        // },
        bgm: {
            default: null,
            type: cc.AudioClip
        },
        吃: {
            default: null,
            type: cc.AudioClip
        },
        星星: {
            default: null,
            type: cc.AudioClip
        },
        正确: {
            default: null,
            type: cc.AudioClip
        },
        落地: {
            default: null,
            type: cc.AudioClip
        },
        错误: {
            default: null,
            type: cc.AudioClip
        },
        门: {
            default: null,
            type: cc.AudioClip
        },
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start() {

    },

    playEffect(name, loop = false, volume = 1) {
        cc.audioEngine.play(this[name], loop, volume);
    }
    // update (dt) {},
});
