protected override void Initialize() { base.Initialize(); rt = new RenderTarget2D(GraphicsDevice, gameWidth, gameHeight); GameServices.AddService <GraphicsDevice>(GraphicsDevice); GameServices.AddService <GraphicsDeviceManager>(graphics); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); GameServices.AddService <SpriteBatch>(spriteBatch); GameServices.AddService <ContentManager>(Content); player.LoadContent(); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); GameServices.AddService <SpriteBatch>(spriteBatch); GameServices.AddService <ContentManager>(Content); player.LoadContent(); Projectile.LoadContent(); Enemy.LoadContent(); Enemy.enemies.Add(new Snake(new Vector2(2, 2))); }
protected override void Update(GameTime gameTime) { GameServices.RemoveService <GameTime>(); GameServices.AddService <GameTime>(gameTime); if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } player.Update(); base.Update(gameTime); }
protected override void Update(GameTime gameTime) { GameServices.RemoveService <GameTime>(); GameServices.AddService <GameTime>(gameTime); //Update calls player.Update(); foreach (Projectile proj in Projectile.projectiles) { proj.Update(); } foreach (Enemy enemy in Enemy.enemies) { enemy.Update(player.Position); } base.Update(gameTime); }
protected override void Initialize() { base.Initialize(); GameServices.AddService <GraphicsDevice>(GraphicsDevice); GameServices.AddService <GraphicsDeviceManager>(graphics); }