home *** CD-ROM | disk | FTP | other *** search
- (* ------------------------------------------------------ *)
- (* WRLDDEMO.PAS *)
- (* Demonstration der Unit WORLD.PAS *)
- (* (C) 1991 Hagen Lehmann & TOOLBOX *)
- (* ------------------------------------------------------ *)
- PROGRAM WrldDemo;
-
- {$IFDEF VER40 }
- {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L- }
- {$ELSE}
- {$A+,B-,D-,E+,F-,I-,L-,N-,O-,R-,S-,V- }
- {$ENDIF}
- {$M 16384,0,655360 }
-
- USES Crt, Graph, World, Dos; { Reihenfolge !!! }
-
- VAR
- Driver, Mode : INTEGER;
- Loop, Worlds : WORD;
- Key : CHAR;
- DriverPath : STRING;
-
- PROCEDURE DrawLines;
- BEGIN
- Rectangle(0, 0, 719, 347);
- FOR Loop := 0 TO 72 DO
- Line(Loop*10, 0, 719-Loop*10, Loop*5);
- END;
-
- PROCEDURE DrawWorld;
- BEGIN
- Rectangle(0, 0, 719, 347);
-
- { W zeichnen }
- MoveTo(60, 100);
- LineRel( 20, 0); LineRel(0, 100);
- LineRel( 20, 0); LineRel(0, -20);
- LineRel( 20, 0); LineRel(0, 20);
- LineRel( 20, 0); LineRel(0, -100);
- LineRel( 20, 0); LineRel(0, 140);
- LineRel(-40, 0); LineRel(0, -20);
- LineRel(-20, 0); LineRel(0, 20);
- LineRel(-40, 0); LineRel(0, -140);
-
- { O zeichnen }
- Rectangle(180, 100, 280, 240);
- Rectangle(200, 120, 260, 220);
-
- { R zeichnen }
- MoveTo(300, 100);
- LineRel(100, 0); LineRel( 0, 80);
- LineRel(-60, 0); LineRel( 60, 40);
- LineRel( 0, 20); LineRel(-20, 0);
- LineRel(-60,-40); LineRel( 0, 40);
- LineRel(-20, 0); LineRel( 0,-140);
- Rectangle(320, 120, 380, 160);
-
- { L zeichnen }
- MoveTo(420, 100);
- LineRel( 20, 0); LineRel(0, 120);
- LineRel( 80, 0); LineRel(0, 20);
- LineRel(-100, 0); LineRel(0,-140);
-
- { D zeichnen }
- MoveTo(540, 100);
- LineRel( 80, 0); LineRel( 20, 20);
- LineRel( 0, 100); LineRel(-20, 20);
- LineRel(-80, 0); LineRel( 0,-140);
- MoveTo(560, 120);
- LineRel( 40, 0); LineRel( 20, 20);
- LineRel( 0, 60); LineRel(-20, 20);
- LineRel(-40, 0); LineRel( 0,-100);
- END;
-
-
- BEGIN
- ClrScr;
- DriverPath := GetEnv('BGIPATH');
- Driver := Detect;
- InitGraph(Driver, Mode, DriverPath);
-
- SetBkColor(1);
- SetColor(14);
-
- GivenWorld(719, 347); { Koordinaten sind von HERCULES }
-
- DefineWorld(1, 0, 0, GetMaxX, GetMaxY, TRUE);
- DefineWorld(2, 0, 0, GetMaxX DIV 2, GetMaxY DIV 2, TRUE);
- DefineWorld(3, GetMaxX DIV 2, 0, GetMaxX,
- GetMaxY DIV 2,TRUE);
- DefineWorld(4, 0, GetMaxY DIV 2, GetMaxX, GetMaxY, TRUE);
-
- FOR Worlds := 1 TO 4 DO BEGIN
- { alle Welten durchspielen }
- SelectWorld(Worlds); { jeweilige Welt übernehmen }
- ClearWorld; { Weltinhalt löschen }
- DrawLines; { Linien mit Herculeskoordinaten zeichnen }
- DrawWorld; { "WORLD" mit Herculeskoordinaten zeichnen }
- Key := ReadKey;
- END;
- CloseGraph;
- END.
- (* ------------------------------------------------------ *)
- (* Ende von WRLDDEMO.PAS *)
-