import { getTexture } from "./utils"


export class Bullets extends engine.Container{

    harm:number
    bulletPic = new engine.Sprite(getTexture('18852543-1f1d-498b-af64-88cd3b343758'))
    constructor(_harm = 1){
        super()
        this.harm = _harm
        this.addChild(this.bulletPic)
    }

    bullet:engine.Sprite 
    public bullets:engine.Sprite[] = []
    
    
    addBullet(planeModel?){
        let bullet = new engine.Sprite(getTexture('18852543-1f1d-498b-af64-88cd3b343758'))

        bullet.x = planeModel ? planeModel.x + planeModel.width / 2 - bullet.width / 2 : 375 - bullet.width / 2 ;
        bullet.y = 1150

        // this.bullets.push(bullet)
        return bullet
    }


    // 创建子弹
    createBullet(planeModel){
        this.x = planeModel.x + planeModel.width / 2 - this.bulletPic.width / 2;
        this.y = 1150;
    }

    // 达到一定分数增加火力
    addBulletNum(w){

    }
    

} 