- Timestamp:
- Apr 12, 2015, 12:36:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UEngine.pas
r25 r26 273 273 NewPassengerPeriod = 0.3 * OneSecond; 274 274 NewPassengerProbability = 0.002; 275 VisiblePassengersPerLine = 6; 275 276 276 277 implementation … … 1642 1643 Angle: Double; 1643 1644 EndPoint: TPoint; 1645 PassengerPos: TPoint; 1646 Direction: Integer; 1644 1647 const 1645 1648 GameOverText = 'Game Over'; … … 1740 1743 Canvas.Pen.Style := psClear; 1741 1744 Canvas.Brush.Color := clBlack; 1745 PassengerPos := Point(0, 0); 1746 Direction := 1; 1742 1747 for P := 0 to Passengers.Count - 1 do 1743 1748 with TMetroPassenger(Passengers[P]) do begin 1744 DrawShape(Canvas, Point(Position.X + StationSize + P * (PassengerSize + 2), Position.Y - StationSize div 2), 1749 DrawShape(Canvas, Point(Position.X + StationSize + PassengerPos.X, 1750 Position.Y - StationSize div 2 + PassengerPos.Y), 1745 1751 Shape, PassengerSize, 0); 1752 PassengerPos := Point(PassengerPos.X + Direction * (PassengerSize + 2), PassengerPos.Y); 1753 if PassengerPos.X >= (PassengerSize + 2) * VisiblePassengersPerLine then begin 1754 Direction := -Direction; 1755 PassengerPos.X := PassengerPos.X - (PassengerSize + 2); 1756 PassengerPos.Y := PassengerPos.Y + (PassengerSize + 2); 1757 end; 1758 if PassengerPos.X < 0 then begin 1759 Direction := -Direction; 1760 PassengerPos.X := 0; 1761 PassengerPos.Y := PassengerPos.Y + (PassengerSize + 2); 1762 end; 1746 1763 end; 1747 1764
Note:
See TracChangeset
for help on using the changeset viewer.