Exemplo n.º 1
0
 internal void ProcessOtherObstacleCollisions(Obstacle obstacle)
 {
     if (BoundingBox.Intersects(obstacle.BoundingBox))
     {
         int direction = 0;
         if (velocity.X > 0)
         {
             direction = 1;
         }
         else if (velocity.X < 0)
         {
             direction = -1;
         }
         obstacle.speed = speed;
         obstacle.MoveHorizontally(direction);
     }
 }
Exemplo n.º 2
0
 internal void ProcessCollisions(Obstacle obstacle)
 {
     if (BoundingBox.Intersects(obstacle.BoundingBox))
     {
         int direction = 0;
         obstacle.speed = Speed;
         if (se == SpriteEffects.None)
         {
             direction = -1;
         }
         else if (se == SpriteEffects.FlipHorizontally)
         {
             direction = 1;
         }
         obstacle.MoveHorizontally(direction);
     }
 }