예제 #1
0
 bool CollideWithMovableObject(MovableEntity movable, Vector3 direction)
 {
     if (movable.CanMove(direction))
     {
         movable.Push(direction);
     }
     else if (SameDirection(direction, my.forward) && !Eating && movable.CanBeEaten(direction) && !ShouldRiseOnEars())
     {
         StartEating(movable, direction);
     }
     else
     {
         return(false);         // blocked by wall
     }
     return(true);
 }