示例#1
0
 public antiRocket(Game game, Nave owner, Vector2 posicao)
     : base(game)
 {
     this.owner = owner;
     setPosition(posicao);
     offset = new Vector2(0, 50);
     Initialize();
 }
示例#2
0
 public Tiro(Game game, int forcaDano, Nave _nave, int _tipoArma)
     : base(game)
 {
     this.setForcaDano(forcaDano);
     this.isAlive = true;
     setPosition(_nave.getPosicaoTirosNavetiro());
     this.nave     = _nave;
     Momentum      = new Vector2((float)Math.Cos(angulo) * 5, (float)Math.Sin(angulo) * 5);
     this.tipoArma = _tipoArma;
 }
示例#3
0
 public antiRocket(Game game, Nave owner, Vector2 posicao,
                   TipoantiRocket.Tipo tipoantiRocket, TipoantiRocket.Habilidade habilidadeantiRocket)
     : base(game)
 {
     this.owner = owner;
     setPosition(posicao);
     this.tipoantiRocket       = tipoantiRocket;
     this.habilidadeantiRocket = habilidadeantiRocket;
     offset = new Vector2(0, 50);
     Initialize();
 }
示例#4
0
 public PursuitRocket(Game game, Nave owner, Vector2 posicao, float orientacao, float massa, float maxVelocidade,
                      float maxForca, Nave naveAlvo) : base(game, new Vector2(), posicao, maxVelocidade)
 {
     posMouse      = new Vector2();
     this.Owner    = owner;
     this.massa    = massa;
     this.maxForca = maxForca;
     this.setDirecao(new Vector2((float)Math.Cos(orientacao), (float)Math.Sin(orientacao)));
     this.naveAlvo         = naveAlvo;
     this.missilAlive      = true;
     listaObjetosColididos = new List <God>();
 }
        public bool ocorreuColisaoNaveMeteoro(Nave nave, bool especial = false)
        {
            Rectangle antiRocketRec = new Rectangle((int)nave.getPosition().X - ((int)nave.getImagem().Width / 2),
                                                    (int)nave.getPosition().Y - ((int)nave.getImagem().Height / 2),
                                                    (int)nave.getImagem().Width, (int)nave.getImagem().Height);

            // Trata a colisao da nave com os Meteoros
            List <Obstaculo> Meteoros = recuperaComponentesObstaculos();

            foreach (Obstaculo prime in Meteoros)
            {
                Rectangle obstaculo = new Rectangle((int)prime.getPosition().X - ((int)prime.getImagem().Width / 2),
                                                    (int)prime.getPosition().Y - ((int)prime.getImagem().Height / 2),
                                                    (int)prime.getImagem().Width, (int)prime.getImagem().Height);
                if (obstaculo.Intersects(antiRocketRec))
                {
                    prime.Dispose();
                    return(true);
                }
            }
            return(false);
        }
示例#6
0
 public void travarAlvo(Nave naveAlvo)
 {
     pursuit = new BehaviorPursuit(naveAlvo);
     wander  = new BehaviorWander(50, new Random().Next(20, 180), 100);
     flee    = new BehaviorFlee();
 }
 public BehaviorPursuit(Nave alvo)
 {
     this.alvo = alvo;
 }