// 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
import {
    showFireworks,
} from '../script/utils';

cc.Class({
    extends: cc.Component,

    properties: {

    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start() {

        const BtnFire = cc.find('Canvas/BtnFire');
        BtnFire.on('click', () => {
            showFireworks(
                cc.find('Canvas/Main Camera'),
                cc.find('RibbonNodeBase').children,
                cc.v2(0, -400), cc.v2(0, 1000), 200, 200
            );
            showFireworks(
                cc.find('Canvas/Main Camera'),
                cc.find('RibbonNodeBase').children,
                cc.v2(-600, -400), cc.v2(200, 1000), 200, 200
            );
            showFireworks(
                cc.find('Canvas/Main Camera'),
                cc.find('RibbonNodeBase').children,
                cc.v2(600, -400), cc.v2(-200, 1000), 200, 200
            );
        });
    },

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