public virtual void Update(GameTime gameTime, List<Player> sprites) { Move(); SetAnimations(); _animationManager.Update(gameTime); // Removed for testing Position += Velocity; Xtrans = (int)Velocity.X; // Testing movement //Xtrans = (int)_position.X; _prevPos = Position; if (_position.X > graphics.PreferredBackBufferWidth/2) { _position.X= (float)(graphics.PreferredBackBufferWidth / 2); Velocity = Vector2.Zero; }
public virtual void Update(GameTime gameTime, List <Player> sprites) { Move(); SetAnimations(); _animationManager.Update(gameTime); Position += Velocity; Xtrans = (int)Velocity.X; _prevPos = Position; if (_position.X > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / 2) { _position.X = (float)(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / 2); } Velocity = Vector2.Zero; }
public virtual void Update(GameTime gameTime, Player player, Dictionary <string, SoundEffect> soundEffects) { RandomMove(player, soundEffects); Position += Velocity; _animationManager.Update(gameTime); SetAnimations(); Velocity = Vector2.Zero; }
public virtual void Update(GameTime gameTime, List <Player> sprites, Dictionary <string, SoundEffect> soundEffects) { Move(soundEffects); SetAnimations(); _animationManager.Update(gameTime); Position += Velocity; Xtrans = Velocity.X; TotalDistance += Xtrans; _prevPos = Position; if (_position.X > graphics.PreferredBackBufferWidth / 2) { Xtrans = _position.X - graphics.PreferredBackBufferWidth / 2; _position.X = (float)(graphics.PreferredBackBufferWidth * 0.5); isHalfway = true; } else if (_position.X < 0) { Xtrans = 0; _position.X = 0; } else { isHalfway = false; } Velocity = Vector2.Zero; }