Exemplo n.º 1
0
 /// <summary>
 /// Checks for a collision between the player and this enemy and deals damage to player when true
 /// </summary>
 private void UpdateAttack(GameTime gameTime)
 {
     if (collidableObject.IsColliding(InGame.player.collidableObject))
     {
         InGame.player.TakeDamage((int)(850 * InGame.difficultyModifier), gameTime);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Updates particle logic
 /// </summary>
 /// <param name="gameTime"></param>
 public void Update(GameTime gameTime)
 {
     // If bullet is colliding with player
     if (collidableObject.IsColliding(InGame.player.collidableObject))
     {
         // Deal damage to player
         InGame.player.TakeDamage(damageType);
         // Kill this particle
         RemoveFromList();
         return;
     }
     // If particle is outside of screen
     if (collidableObject.Position.X < 0 || collidableObject.Position.Y < 0 || collidableObject.Position.X > Game1.ScreenBounds.X)
     {
         RemoveFromList();
         return;
     }
     // Update position
     collidableObject.Position += direction * velocity * gameTime.ElapsedGameTime.Milliseconds;
 }
Exemplo n.º 3
0
 public void Update(GameTime gameTime)
 {
     Color = collidableObject.IsColliding(InGame.player.collidableObject) ? Color.Red : Color.White;
 }