/// <summary> /// Allows the game component to update itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public void Update(GameTime gameTime, ScreenManager screenManager) { this.screenManager = screenManager; Input.Update(); btnBack.Update((float)gameTime.ElapsedGameTime.TotalSeconds); Controls(); base.Update(gameTime); }
public void Update(GameTime gameTime, ScreenManager screenManager) { this.screenManager = screenManager; Input.Update(); foreach (Button b in buttons) { b.Update((float)gameTime.ElapsedGameTime.TotalSeconds); } Controls(); base.Update(gameTime); }
public void Update(float elaps, float yaccel, ScreenManager screenManager) { this.screenManager = screenManager; btnRight.Update(elaps); btnLeft.Update(elaps); btnJump.Update(elaps); btnPause.Update(elaps); if (position.Y >= 300) { onGround = true; position.Y = 300; } else onGround = false; Controls(); ay = yaccel; base.Update(elaps); Camera2d.Position = position + (Stuff.AngleToVector(sprite.Rotation + (float)Math.PI) * 20); }
public void Update(GameTime gameTime, ScreenManager screenManager) { DrawRect = new Rectangle((int)player.Position.X - (graphics.PreferredBackBufferWidth / 2) - 150, (int)player.Position.Y - (graphics.PreferredBackBufferHeight / 2) - 150, graphics.PreferredBackBufferWidth + 300, graphics.PreferredBackBufferHeight + 300); elaps = (float)gameTime.ElapsedGameTime.TotalSeconds; totaltPlayTime += elaps; Input.Update(); onScreenMessages.Update(elaps); int c = characters.Count; for (int i = 0; i < c; i++) { characters[i].Update(elaps); } player.Update(elaps, yaccel, screenManager); }