const {ccclass, property} = cc._decorator;

@ccclass
export default class starGeneration extends cc.Component {

    onLoad () {
        this.map = cc.find("Map")        
    }
    init () {
        return Math.ceil(Math.random()*10) % 2 === 0 ? this.createStar() : ''
    }
    createStar () {
        this.map.getComponent('map-control').getStarPool(this.node);
    }
}