Пример #1
0
        private void LeaveTheBuilding()
        {
            //Update starting position
            this.PassengerPosition = new Point(PassengerPosition.X, myElevator.GetElevatorYPosition());

            //Flip the control
            this.FlipPassengerGraphicHorizontally();

            //Make the passenger visible
            this.visible = true;

            //Move the passenger up to the exit
            this.MovePassengersGraphicHorizontally(myBuilding.ExitLocation);

            //Make the passenger invisible again
            //TO DO: dispose object instead making it invisble
            this.visible = false;

            //No need to animate it
            myBuilding.ListOfAllPeopleWhoNeedAnimation.Remove(this);
        }
Пример #2
0
 private void PaintElevators(Graphics g)
 {
     for (int i = 0; i < MyBuilding.ArrayOfAllElevators.Length; i++)
     {
         Elevator ElevatorToPaint = MyBuilding.ArrayOfAllElevators[i];
         g.DrawImage(ElevatorToPaint.GetCurrentFrame(), ElevatorToPaint.GetElevatorXPosition(), ElevatorToPaint.GetElevatorYPosition(), 54, 90);
     }
 }