SpiralRock

Tushar

May 11th, 2010
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.01 KB | None | 0 0
  1. //today i have to complete VicePort
  2. #include<iostream.h>
  3. #include<conio.h>
  4. #include<graphics.h>
  5. #include<time.h>
  6. #include<dos.h>
  7. #include<stdio.h>
  8.  
  9. #define MINX 0
  10. #define MAXX 640
  11. #define MINY 0
  12. #define MAXY 480
  13. //----------------------------------------------------------->>
  14.  
  15. int Map();
  16. int VicePort();
  17.  
  18.  
  19. //----------------------------------------------------------->>
  20. //
  21. int Map() {
  22.  
  23. //Waterbodies code
  24. setbkcolor(1);
  25. setfillstyle(10,9);
  26. bar(MINX,MINY,MAXX,MAXY);
  27.  
  28. //Havana Island Rectangle Code
  29. int LeftHavana = 75;
  30. int TopHavana = 50;
  31. int RightHavana= 580;
  32. int BottomHavana= 150;
  33. setfillstyle(1,2);
  34. bar(LeftHavana, TopHavana, RightHavana, BottomHavana);
  35.  
  36. //Starfish Island Circle code
  37. int StarfishX = 320;
  38. int StarfishY = 250;
  39. int StarfishRadius = 50;
  40. setcolor(2);
  41. circle(StarfishX, StarfishY, StarfishRadius);
  42. floodfill(320,250,2);
  43.  
  44. //VC Island Circle Code
  45. int LeftVC = 75;
  46. int TopVC = 380;
  47. int RightVC= 580;
  48. int BottomVC= 470;
  49. bar(LeftVC, TopVC, RightVC, BottomVC);
  50.  
  51. //Island connecting Highways
  52. //Havana-Starfish Highway (HS)
  53. setfillstyle(1,8);
  54. int LeftHS = 320;
  55. int TopHS = 150;
  56. int RightHS = 325;
  57. int BottomHS = 200;
  58. bar(LeftHS,TopHS,RightHS,BottomHS);
  59. //Starfish-VC Haighway (SV)
  60. int LeftSV = 320;
  61. int TopSV =  300;
  62. int RightSV = 325;
  63. int BottomSV = 400;
  64. bar(LeftSV,TopSV,RightSV,BottomSV);
  65. //Left Havana-VC Highway (LHV)
  66. int LeftLHV = 150;
  67. int TopLHV = 150;
  68. int RightLHV = 155;
  69. int BottomLHV = 400;
  70. bar(LeftLHV,TopLHV,RightLHV,BottomLHV);
  71. //Right Havana-VC Highway (RHV)
  72. int LeftRHV = 540;
  73. int TopRHV = 150;
  74. int RightRHV = 545;
  75. int BottomRHV = 400;
  76. bar(LeftRHV,TopRHV,RightRHV,BottomRHV);
  77.  
  78. //Internal Highways
  79.  
  80. //Starfish Highway (S)
  81. int LeftS = 320;
  82. int TopS = 200;
  83. int RightS = 325;
  84. int BottomS = 300;
  85. bar(LeftS,TopS,RightS,BottomS);
  86.  
  87. //Vice City Horizontal-Top Highway (VCHT)
  88. int LeftVCHT = 100;
  89. int TopVCHT = 400;
  90. int RightVCHT = 565;
  91. int BottomVCHT = 395;
  92. bar(LeftVCHT,TopVCHT,RightVCHT,BottomVCHT);
  93. //Vice City Vertical-Left Highway (VCVL)
  94. int LeftVCVL =100;
  95. int TopVCVL = 400;
  96. int RightVCVL =105;
  97. int BottomVCVL =450;
  98. bar(LeftVCVL,TopVCVL,RightVCVL,BottomVCVL);
  99. //Vice City Vertical - Right Haighway (VCVR)
  100. int LeftVCVR=560;
  101. int TopVCVR=400;
  102. int RightVCVR=565;
  103. int BottomVCVR=450;
  104. bar(LeftVCVR,TopVCVR,RightVCVR,BottomVCVR);
  105. //Vice City Horizontal-Bottom Highway (VCHB)
  106. int LeftVCHB=100;
  107. int TopVCHB= 450;
  108. int RightVCHB=565;
  109. int BottomVCHB=455;
  110. bar(LeftVCHB,TopVCHB,RightVCHB,BottomVCHB);
  111.  
  112. //Havana Highway
  113. //Havana Horizontal-top highway (hht)
  114. int lefthht=100;
  115. int tophht=70;
  116. int righthht=565;
  117. int bottomhht=65;
  118. bar(lefthht,tophht,righthht,bottomhht);
  119. //havana horizontal-bottom highway(hhb)
  120. int lefthhb=105;
  121. int tophhb=130;
  122. int righthhb=560;
  123. int bottomhhb=125;
  124. bar(lefthhb,tophhb,righthhb,bottomhhb);
  125. //havana vertical-left highway (hvl)
  126. int lefthvl=100;
  127. int tophvl=70;
  128. int righthvl=105;
  129. int bottomhvl=130;
  130. bar(lefthvl,tophvl,righthvl,bottomhvl);
  131. //havana vertical-right highway (hvr)
  132. int lefthvr=560;
  133. int tophvr=65;
  134. int righthvr=565;
  135. int bottomhvr=130;
  136. bar(lefthvr,tophvr,righthvr,bottomhvr);
  137.  
  138. //main connecting roads
  139.  
  140. //havana vertical-centre road(hvcr)
  141. int lefthvcr=320;
  142. int tophvcr=70;
  143. int righthvcr=325;
  144. int bottomhvcr=130;
  145. bar(lefthvcr,tophvcr,righthvcr,bottomhvcr);
  146. //havana vertical-left road (hvlr)
  147. int lefthvlr=213;
  148. int tophvlr=70;
  149. int righthvlr=218;
  150. int bottomhvlr=130;
  151. bar(lefthvlr,tophvlr,righthvlr,bottomhvlr);
  152. //havana vertical-right road (hvrr)
  153. int lefthvrr=442;
  154. int tophvrr=70;
  155. int righthvrr=447;
  156. int bottomhvrr=130;
  157. bar(lefthvrr,tophvrr,righthvrr,bottomhvrr);
  158.  
  159. //havana small roads
  160. //havana road connecting to starfish haighway (hcsh)
  161. int lefthcsh=320;
  162. int tophcsh=130;
  163. int righthcsh=325;
  164. int bottomhcsh=150;
  165. bar(lefthcsh,tophcsh,righthcsh,bottomhcsh);
  166. //havana left road connecting VC highway (hlcv)
  167. bar(150,130,155,150);
  168. //havana right road connecting VC highway
  169. bar(540,130,545,150);
  170.  
  171. //VC main roads
  172. bar(442,400,447,450);
  173. bar(213,400,218,450);
  174.  
  175. //Places Name on map
  176. setcolor(6);
  177. outtextxy(270,250,"Starfish Island");
  178. outtextxy(130,420,"Washington");
  179. outtextxy(280,420,"Ocean Beach");
  180. outtextxy(490,420,"Vice Point");
  181. outtextxy(130,95,"Vice Port");
  182. outtextxy(280,95,"Little Haiti");
  183. outtextxy(490,95,"Downtown");
  184. setcolor(5);
  185. settextstyle(3, HORIZ_DIR, 4);
  186. outtextxy(280,10,"MAP");
  187. return 0;
  188. }
  189.  
  190. int Viceport() {
  191. //water body
  192. setbkcolor(1);
  193. setfillstyle(10,9);
  194. bar(MINX,MINY,MAXX,MAXY);
  195.  
  196. //terrain
  197. setfillstyle(1,2);
  198. bar(100,28,640,420);
  199.  
  200. //roads
  201. //horizontal bottom road
  202. setfillstyle(1,8);
  203. bar(150,360,640,390);
  204.  
  205. return 0;
  206. }
  207. /*int IngameTime(int start);
  208.  
  209. int IngameTime(int start){
  210.     clock_t end;
  211.     clrscr();
  212.     end=clock();
  213.     int X,Y;
  214.     X=20;
  215.     Y=2;
  216.     outtextxy(X,Y,(end-start));
  217.     return 0;
  218.     }
  219. */
  220. void main() {
  221.  
  222. int gd = DETECT, gm;
  223. initgraph(&gd, &gm, "C:\\TC\\bgi");
  224.  
  225. //int GameMode=1;
  226.  
  227. //clock_t start, end;
  228.  
  229. /*
  230. while (GameMode==1); {
  231.     start = clock();
  232.     IngameTime(start);
  233.     delay(1000);
  234.     }
  235. */
  236. //Map(); ------> for now
  237. Viceport();
  238. getch();
  239. closegraph();
  240. }
Add Comment
Please, Sign In to add comment