/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here aviao = new Aviao(); tiro = null; obstaculo = null; tiroPreparado = false; tempoTiro = 0; gt = new GerenciadorTiro(); go = new GerenciadorObstaculo(); rnd = new Random(); IsMouseVisible = true; posbutton = new Rectangle(250, 400, 300, 100); posButton2 = new Rectangle(250, 200, 300, 100); posButton3 = new Rectangle(250, 300, 300, 100); base.Initialize(); }
public bool Colisaodoavisao(Obstaculo[] obs, Aviao Avi) { if (aviaovivo) { for (int i = 0; i < obs.Length; i++) { if (obs[i].ativo) { for (int j = 0; j < obs.Length; j++) { if (Avi.pos.Intersects(obs[j].pos)) { aviaovivo = false; obs[j].atingido = true; } } } } } return(true); }
public static void draw(Aviao aviao, SpriteBatch spriteBatch, Texture2D texture) { spriteBatch.Draw(texture, aviao.pos, Color.White); }