/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); niebo = Content.Load <Texture2D>("niebo"); control = Content.Load <Texture2D>("control"); animRakiety = Content.Load <Texture2D>("AnimRakiety"); meteor = Content.Load <Texture2D>("meteor"); pocisk = Content.Load <Texture2D>("pocisk2D"); gameOver = Content.Load <Texture2D>("gameOver"); wybuchRaz = Content.Load <Song>("boom"); font = Content.Load <SpriteFont>("czcionka"); nrKlatki_Rakieta = 0; nrKlatki_Meteor = 0; ileCykli = 0; punkty = 0; gracz = new Rakieta(animRakiety, pocisk); wrog = new Meteor(meteor); wrog2 = new Meteor(meteor); }
public void Draw(Texture2D texture2D, Texture2D texture2D_2, SpriteBatch spriteBatch, Rakieta rakieta, Rectangle rectangle) { Rectangle rectGracza = new Rectangle((int)rakieta.GetPosition().X, (int)rakieta.GetPosition().Y, rectangle.Width, rectangle.Height); spriteBatch.Draw(texture2D, rectGracza, rectangle, Color.White); if (strzal.wystrzelony) { spriteBatch.Draw(texture2D_2, strzal.position, Color.White); } }