public override void Update(GameTime gameTime, Player player, TileMap map) { animation.Update(gameTime, null); if ((rectangle.Intersects(player.rectangle)) & (isActive)) { sound.PlaySound(); isActive = false; player.points += value; } }
public override void Update(GameTime gameTime, Player player, TileMap map) { wasChecked = isChecked; if (isChecked) { animation.Update(gameTime, null); } if (rectangle.Intersects(player.rectangle)) { isChecked = true; } }
public override void Update(GameTime gameTime, Player player, TileMap map) { if (wasAccepted & Keyboard.GetState().IsKeyUp(Keys.Space)) { isActive = false; wasAccepted = false; } if ((Keyboard.GetState().IsKeyDown(Keys.Space)) & (isActive)) { wasAccepted = true; } else { animatedTexture.Update(gameTime, null); CheckTrigger(player); } }
public virtual void Update(GameTime gameTime, Player player, TileMap map, List <MovableItem> movableList) { if ((isAlive) & (deathTime <= 80)) { FrictionCount(); if (!canFly & isAlive & !isOnLadder) { GravitySimulation(); } IsOnObstracles(map); CheckEnviromentColision(map); CheckColisionWithMovables(movableList, map); UpdatePosition(); if (attacking > 0) { attacking--; } if (lifePoints <= 0) { isAlive = false; deathAnimation.UpdateRectangle(rectangle); velocity = Vector2.Zero; } } else { GravitySimulation(); CheckEnviromentColision(map); UpdatePosition(); deathTime++; deathAnimation.Update(gameTime, null); } animatedTexture.Update(gameTime, this); }
public override void Update(GameTime gameTime, Player player, TileMap map) { animation.Update(gameTime, player); base.Update(gameTime, player, map); }