Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 97.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <ctype.h>
  4. #include <conio.h>
  5. #include <vector>
  6.  
  7. #define IZQUIERDA 'A'
  8. #define DERECHA 'D'
  9.  
  10. using namespace std;
  11. using namespace System;
  12. enum Colores { NEGRO, ROJO, AZUL, BLANCO, VERDE, AMARILLO }; enum color2 { MORADO };
  13. void CambiarColorFondo(Colores color) {
  14. switch (color)
  15. {
  16. case BLANCO: Console::BackgroundColor = ConsoleColor::White; break;
  17. case NEGRO: Console::BackgroundColor = ConsoleColor::Black; break;
  18. case ROJO: Console::BackgroundColor = ConsoleColor::Red; break;
  19. case AZUL: Console::BackgroundColor = ConsoleColor::Blue; break;
  20. case AMARILLO: Console::BackgroundColor = ConsoleColor::Yellow; break;
  21. case VERDE: Console::BackgroundColor = ConsoleColor::Green; break;
  22. }
  23. }
  24. void CambiarColorLetra(Colores color) {
  25. switch (color) {
  26. case BLANCO: Console::ForegroundColor = ConsoleColor::White; break;
  27. case NEGRO: Console::ForegroundColor = ConsoleColor::Black; break;
  28. case ROJO: Console::ForegroundColor = ConsoleColor::Red; break;
  29. case AZUL: Console::ForegroundColor = ConsoleColor::Blue; break;
  30. case AMARILLO: Console::ForegroundColor = ConsoleColor::Yellow; break;
  31. case VERDE: Console::ForegroundColor = ConsoleColor::Green; break;
  32. }
  33. }
  34. void galaga() {
  35. CambiarColorLetra(VERDE);
  36. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  37. cout << "XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX" << endl;
  38. cout << "Xx::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::xX" << endl;
  39. cout << "Xx::..................................................................................................::xX" << endl;
  40. cout << "Xx::. .::xX" << endl;
  41. cout << "Xx::. .::xX" << endl;
  42. cout << "Xx::. .::xX" << endl;
  43. cout << "Xx::. .::xX" << endl;
  44. cout << "Xx::. .::xX" << endl;
  45. cout << "Xx::. .::xX" << endl;
  46. cout << "Xx::. .....xxxxxxxxx.... .::xX" << endl;
  47. cout << "Xx::. ..XXXXXXXXXXXXXXXXXXXXXXXXXXXX... ..xXXXX. .::xX" << endl;
  48. cout << "Xx::. ..XXXXXXXXX. ...XXXXXXXXX .xX. xXx. .::xX" << endl;
  49. cout << "Xx::. .XXXX. xX. .XXXXXXXXXXXXxx. xxx. .::xX" << endl;
  50. cout << "Xx::. .xxxxxxxx. .XXXX .xXXX. .xXXx. .xx. .::xX" << endl;
  51. cout << "Xx::. .XXXX. xxxXXXX XXX. xxXXxx.x .::xX" << endl;
  52. cout << "Xx::. .XX. XXXX XXX. .x. .::xX" << endl;
  53. cout << "Xx::. XX X. XXX. .xx. .::xX" << endl;
  54. cout << "Xx::. XX . . XXX. . .x. ..x .::xX" << endl;
  55. cout << "Xx::. .XX X .xXXXX. XXX. .xXXXX. xxxxXXXX. .xXXXX. .::xX" << endl;
  56. cout << "Xx::. XXX Xxxxx .xXXxXXXXX XXX.xXXxXXXXX XXXX. xXX. xXXxXXXXX .::xX" << endl;
  57. cout << "Xx::. XXXX .XXXXXX .XX XX XXX. .XX XX xXx. .Xx .XX XX .::xX" << endl;
  58. cout << "Xx::. XXXXX XXXx XX XX . XXX. XX XX . XXXXXXXXX XX XX . .::xX" << endl;
  59. cout << "Xx::. XXXXXXX XXXXXXXXxxX XXXXxXXXx XXX. XXXXxXXXx . .xx XXXXxXXXx .::xX" << endl;
  60. cout << "Xx::. XXXXXXXXXXXXXXXXXXxXXXxxXX xx x XX. xx x .XXXXXXXxx. .xx x .::xX" << endl;
  61. cout << "Xx::. XXXXXXXXXXXxxxXXxxxxxXXX . .xXXxxx .::xX" << endl;
  62. cout << "Xx::. XXXXXXXXX xxXXX. .xX XXX .::xX" << endl;
  63. cout << "Xx::. x XXXX ..xXX. .::xX" << endl;
  64. cout << "Xx::. .XXXXXXXXXXXx .::xX" << endl;
  65. cout << "Xx::. .XXXXXXxxx. .::xX" << endl;
  66. cout << "Xx::. .x. .::xX" << endl;
  67. cout << "Xx::. .::xX" << endl;
  68. cout << "Xx::. .::xX" << endl;
  69. cout << "Xx::. .::xX" << endl;
  70. cout << "Xx::. .::xX" << endl;
  71. cout << "Xx::. .::xX" << endl;
  72. cout << "Xx::..................................................................................................::xX" << endl;
  73. cout << "Xx::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::xX" << endl;
  74. cout << "XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX" << endl;
  75. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  76.  
  77. system("pause>0");
  78. system("cls");
  79. }
  80. void marco() {
  81. CambiarColorLetra(AMARILLO);
  82. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  83. cout << "X X" << endl;
  84. cout << "X X" << endl;
  85. cout << "X X" << endl;
  86. cout << "X X" << endl;
  87. cout << "X X" << endl;
  88. cout << "X X" << endl;
  89. cout << "X X" << endl;
  90. cout << "X X" << endl;
  91. cout << "X X" << endl;
  92. cout << "X X" << endl;
  93. cout << "X X" << endl;
  94. cout << "X X" << endl;
  95. cout << "X X" << endl;
  96. cout << "X X" << endl;
  97. cout << "X X" << endl;
  98. cout << "X X" << endl;
  99. cout << "X X" << endl;
  100. cout << "X X" << endl;
  101. cout << "X X" << endl;
  102. cout << "X X" << endl;
  103. cout << "X X" << endl;
  104. cout << "X X" << endl;
  105. cout << "X X" << endl;
  106. cout << "X X" << endl;
  107. cout << "X X" << endl;
  108. cout << "X X" << endl;
  109. cout << "X X" << endl;
  110. cout << "X X" << endl;
  111. cout << "X X" << endl;
  112. cout << "X X" << endl;
  113. cout << "X X" << endl;
  114. cout << "X X" << endl;
  115. cout << "X X" << endl;
  116. cout << "X X" << endl;
  117. cout << "X X" << endl;
  118. cout << "X X" << endl;
  119. cout << "X X" << endl;
  120. cout << "X X" << endl;
  121. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  122. system("pause>0");
  123. }
  124. void level1() {
  125. CambiarColorLetra(AZUL);
  126. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  127. cout << "X X" << endl;
  128. cout << "X X" << endl;
  129. cout << "X X" << endl;
  130. cout << "X X" << endl;
  131. cout << "X X" << endl;
  132. cout << "X X" << endl;
  133. cout << "X X" << endl;
  134. cout << "X X" << endl;
  135. cout << "X X" << endl;
  136. cout << "X X" << endl;
  137. cout << "X X" << endl;
  138. cout << "X X" << endl;
  139. cout << "X ____ ____ ____ ___ ___ ____________ ____ ________ X" << endl;
  140. cout << "X | * | | | | | | | | | | | | / | X" << endl;
  141. cout << "X | * | | | | | | | | | _______| | | / | X" << endl;
  142. cout << "X | * | | | | | | | | | | | | / _ | X" << endl;
  143. cout << "X | * | | | | | * * | | |_____ | | /____/ | | X" << endl;
  144. cout << "X | *| | | | * * * * | | | | | | X" << endl;
  145. cout << "X | | | | * * * * | _____| | | | | X" << endl;
  146. cout << "X | * | | | * * * * | | | | | | X" << endl;
  147. cout << "X | |* | | | * * * | | | | | | X" << endl;
  148. cout << "X | | * | | | * * | |_______ | |_______ | | X" << endl;
  149. cout << "X | | * | | | * * | | | | | | X" << endl;
  150. cout << "X |____| *_____| |____| *___* |____________| |____________| |_____| X" << endl;
  151. cout << "X X" << endl;
  152. cout << "X X" << endl;
  153. cout << "X X" << endl;
  154. cout << "X X" << endl;
  155. cout << "X X" << endl;
  156. cout << "X X" << endl;
  157. cout << "X X" << endl;
  158. cout << "X X" << endl;
  159. cout << "X X" << endl;
  160. cout << "X X" << endl;
  161. cout << "X X" << endl;
  162. cout << "X X" << endl;
  163. cout << "X X" << endl;
  164. cout << "X X" << endl;
  165. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  166. system("pause>0");
  167. }
  168. void level2() {
  169. CambiarColorLetra(AZUL);
  170. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  171. cout << "X X" << endl;
  172. cout << "X X" << endl;
  173. cout << "X X" << endl;
  174. cout << "X X" << endl;
  175. cout << "X X" << endl;
  176. cout << "X X" << endl;
  177. cout << "X X" << endl;
  178. cout << "X X" << endl;
  179. cout << "X X" << endl;
  180. cout << "X X" << endl;
  181. cout << "X X" << endl;
  182. cout << "X X" << endl;
  183. cout << "X ____ ____ ____ ___ ___ ____________ ____ _____ X" << endl;
  184. cout << "X | * | | | | | | | | | | | | _* * _ X" << endl;
  185. cout << "X | * | | | | | | | | | _______| | | * _____ *_ X" << endl;
  186. cout << "X | * | | | | | | | | | | | | | | * | X" << endl;
  187. cout << "X | * | | | | | * * | | |_____ | | |___| | | X" << endl;
  188. cout << "X | *| | | | * * * * | | | | _* _* X" << endl;
  189. cout << "X | | | | * * * * | _____| | | _* _* X" << endl;
  190. cout << "X | * | | | * * * * | | | | _* _* X" << endl;
  191. cout << "X | |* | | | * * * | | | | _* _* X" << endl;
  192. cout << "X | | * | | | * * | |_______ | |_______ __* _*_______ X" << endl;
  193. cout << "X | | * | | | * * | | | | | | X" << endl;
  194. cout << "X |____| *_____| |____| *___* |____________| |____________| |_________________| X" << endl;
  195. cout << "X X" << endl;
  196. cout << "X X" << endl;
  197. cout << "X X" << endl;
  198. cout << "X X" << endl;
  199. cout << "X X" << endl;
  200. cout << "X X" << endl;
  201. cout << "X X" << endl;
  202. cout << "X X" << endl;
  203. cout << "X X" << endl;
  204. cout << "X X" << endl;
  205. cout << "X X" << endl;
  206. cout << "X X" << endl;
  207. cout << "X X" << endl;
  208. cout << "X X" << endl;
  209. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  210. system("pause>0");
  211. }
  212. void level3() {
  213. CambiarColorLetra(AZUL);
  214. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  215. cout << "X X" << endl;
  216. cout << "X X" << endl;
  217. cout << "X X" << endl;
  218. cout << "X X" << endl;
  219. cout << "X X" << endl;
  220. cout << "X X" << endl;
  221. cout << "X X" << endl;
  222. cout << "X X" << endl;
  223. cout << "X X" << endl;
  224. cout << "X X" << endl;
  225. cout << "X X" << endl;
  226. cout << "X X" << endl;
  227. cout << "X ____ ____ ____ ___ ___ ____________ ____ _____ X" << endl;
  228. cout << "X | * | | | | | | | | | | | | _* * _ X" << endl;
  229. cout << "X | * | | | | | | | | | _______| | | * _____ *_ X" << endl;
  230. cout << "X | * | | | | | | | | | | | | |___| * | X" << endl;
  231. cout << "X | * | | | | | * * | | |_____ | | ____* _* X" << endl;
  232. cout << "X | *| | | | * * * * | | | | | _* X" << endl;
  233. cout << "X | | | | * * * * | _____| | | |____ *. X" << endl;
  234. cout << "X | * | | | * * * * | | | | ___ *- *- X" << endl;
  235. cout << "X | |* | | | * * * | | | | | | | * X" << endl;
  236. cout << "X | | * | | | * * | |_______ | |_______ *- *-____ * - X" << endl;
  237. cout << "X | | * | | | * * | | | | *_ _* X" << endl;
  238. cout << "X |____| *_____| |____| *___* |____________| |____________| *-______--* X" << endl;
  239. cout << "X X" << endl;
  240. cout << "X X" << endl;
  241. cout << "X X" << endl;
  242. cout << "X X" << endl;
  243. cout << "X X" << endl;
  244. cout << "X X" << endl;
  245. cout << "X X" << endl;
  246. cout << "X X" << endl;
  247. cout << "X X" << endl;
  248. cout << "X X" << endl;
  249. cout << "X X" << endl;
  250. cout << "X X" << endl;
  251. cout << "X X" << endl;
  252. cout << "X X" << endl;
  253. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  254. system("pause>0");
  255. }
  256. void level4() {
  257. CambiarColorLetra(AZUL);
  258. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  259. cout << "X X" << endl;
  260. cout << "X X" << endl;
  261. cout << "X X" << endl;
  262. cout << "X X" << endl;
  263. cout << "X X" << endl;
  264. cout << "X X" << endl;
  265. cout << "X X" << endl;
  266. cout << "X X" << endl;
  267. cout << "X X" << endl;
  268. cout << "X X" << endl;
  269. cout << "X X" << endl;
  270. cout << "X X" << endl;
  271. cout << "X ____ ____ ____ ___ ___ ____________ ____ ______ X" << endl;
  272. cout << "X | * | | | | | | | | | | | | * | X" << endl;
  273. cout << "X | * | | | | | | | | | _______| | | * *| | X" << endl;
  274. cout << "X | * | | | | | | | | | | | | * * | | X" << endl;
  275. cout << "X | * | | | | | * * | | |_____ | | * * | | X" << endl;
  276. cout << "X | *| | | | * * * * | | | | * *____ |__ X" << endl;
  277. cout << "X | | | | * * * * | _____| | | | | X" << endl;
  278. cout << "X | * | | | * * * * | | | | |_________ __| X" << endl;
  279. cout << "X | |* | | | * * * | | | | | | X" << endl;
  280. cout << "X | | * | | | * * | |_______ | |_______ | | X" << endl;
  281. cout << "X | | * | | | * * | | | | | | X" << endl;
  282. cout << "X |____| *_____| |____| *___* |____________| |____________| |____| X" << endl;
  283. cout << "X X" << endl;
  284. cout << "X X" << endl;
  285. cout << "X X" << endl;
  286. cout << "X X" << endl;
  287. cout << "X X" << endl;
  288. cout << "X X" << endl;
  289. cout << "X X" << endl;
  290. cout << "X X" << endl;
  291. cout << "X X" << endl;
  292. cout << "X X" << endl;
  293. cout << "X X" << endl;
  294. cout << "X X" << endl;
  295. cout << "X X" << endl;
  296. cout << "X X" << endl;
  297. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  298. system("pause>0");
  299. }
  300. void ganaste() {
  301. CambiarColorLetra(AMARILLO);
  302. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  303. cout << "X X" << endl;
  304. cout << "X X" << endl;
  305. cout << "X X" << endl;
  306. cout << "X X" << endl;
  307. cout << "X X" << endl;
  308. cout << "X X" << endl;
  309. cout << "X X" << endl;
  310. cout << "X X" << endl;
  311. cout << "X X" << endl;
  312. cout << "X X" << endl;
  313. cout << "X X" << endl;
  314. cout << "X X" << endl;
  315. cout << "X X" << endl;
  316. cout << "X .xXXXXXx. X Xx X X xXXXXx. XXXXXXXXXXX XXXXXXXXX X" << endl;
  317. cout << "X /* X X X X X X X X X X X" << endl;
  318. cout << "X X .X X. X X X .X X. X X X X" << endl;
  319. cout << "X X X X X X X X X Xx_ X X X" << endl;
  320. cout << "X X .X X. X X X .X X. *XXXx. X XXXXXX X" << endl;
  321. cout << "X X xXXx .XXXXXXXXX. X X X .XXXXXXXXX. x X X X" << endl;
  322. cout << "X X X X X X X X X X X X X X" << endl;
  323. cout << "X .X .X .X X. X X X .X X. x x X X X" << endl;
  324. cout << "X *XXXXX* X X X Xx X X XXXXXXX* X XXXXXXXXX X" << endl;
  325. cout << "X X" << endl;
  326. cout << "X X" << endl;
  327. cout << "X X" << endl;
  328. cout << "X X" << endl;
  329. cout << "X X" << endl;
  330. cout << "X X" << endl;
  331. cout << "X X" << endl;
  332. cout << "X X" << endl;
  333. cout << "X X" << endl;
  334. cout << "X X" << endl;
  335. cout << "X X" << endl;
  336. cout << "X X" << endl;
  337. cout << "X X" << endl;
  338. cout << "X ELIZABETH NINA GUTIERREZ X" << endl;
  339. cout << "X X" << endl;
  340. cout << "X X" << endl;
  341. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  342. system("pause>0");
  343. }
  344. void perdiste() {
  345. CambiarColorLetra(ROJO);
  346. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  347. cout << "X X" << endl;
  348. cout << "X X" << endl;
  349. cout << "X X" << endl;
  350. cout << "X X" << endl;
  351. cout << "X X" << endl;
  352. cout << "X X" << endl;
  353. cout << "X X" << endl;
  354. cout << "X X" << endl;
  355. cout << "X X" << endl;
  356. cout << "X X" << endl;
  357. cout << "X X" << endl;
  358. cout << "X X" << endl;
  359. cout << "X X" << endl;
  360. cout << "X XXXXXXx. XXXXXXXXX XXXXXXx. XXXXXXx. X xXXXXx. XXXXXXXXXXX XXXXXXXXX X" << endl;
  361. cout << "X X *X. X X *X. X *X. X X X X X" << endl;
  362. cout << "X X X X X X X X X X X X X" << endl;
  363. cout << "X X .x* X X .x* X X X Xx_ X X X" << endl;
  364. cout << "X XXXXXX* XXXXXX XXXXXX* X X X *XXXx. X XXXXXX X" << endl;
  365. cout << "X X X X *x X X X x X X X" << endl;
  366. cout << "X X X X *x X X X X X X X" << endl;
  367. cout << "X X X X X X .x* X x x X X X" << endl;
  368. cout << "X X XXXXXXXXX X X XXXXXX* X XXXXXXX* X XXXXXXXXX X" << endl;
  369. cout << "X X" << endl;
  370. cout << "X X" << endl;
  371. cout << "X X" << endl;
  372. cout << "X X" << endl;
  373. cout << "X X" << endl;
  374. cout << "X X" << endl;
  375. cout << "X X" << endl;
  376. cout << "X X" << endl;
  377. cout << "X X" << endl;
  378. cout << "X X" << endl;
  379. cout << "X X" << endl;
  380. cout << "X X" << endl;
  381. cout << "X X" << endl;
  382. cout << "X X" << endl;
  383. cout << "X X" << endl;
  384. cout << "X X" << endl;
  385. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  386. system("pause>0");
  387. }
  388. void instrucciones() {
  389. CambiarColorLetra(ROJO);
  390. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  391. cout << "X X" << endl;
  392. cout << "X X" << endl;
  393. cout << "X X" << endl;
  394. cout << "X X" << endl;
  395. cout << "X X" << endl;
  396. cout << "X X" << endl;
  397. cout << "X X" << endl;
  398. cout << "X X" << endl;
  399. cout << "X X" << endl;
  400. cout << "X X" << endl;
  401. cout << "X X" << endl;
  402. cout << "X X" << endl;
  403. cout << "X X" << endl;
  404. cout << "X --------------------------------- INSTRUCCIONES: ------------------------------ X" << endl;
  405. cout << "X X" << endl;
  406. cout << "X [ESPACIO] -> Disparar X" << endl;
  407. cout << "X [A] -> Mover nave a la izquierda X" << endl;
  408. cout << "X [D] -> Mover nave a la derecha X" << endl;
  409. cout << "X X" << endl;
  410. cout << "X X" << endl;
  411. cout << "X X" << endl;
  412. cout << "X X" << endl;
  413. cout << "X X" << endl;
  414. cout << "X X" << endl;
  415. cout << "X X" << endl;
  416. cout << "X X" << endl;
  417. cout << "X X" << endl;
  418. cout << "X X" << endl;
  419. cout << "X X" << endl;
  420. cout << "X X" << endl;
  421. cout << "X X" << endl;
  422. cout << "X X" << endl;
  423. cout << "X X" << endl;
  424. cout << "X X" << endl;
  425. cout << "X X" << endl;
  426. cout << "X X" << endl;
  427. cout << "X X" << endl;
  428. cout << "X X" << endl;
  429. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;//121-82
  430. system("pause>0");
  431. }
  432. typedef struct avispa {
  433. short x = 10; short y = 10; short mx = 1; short my = 1; int pasos = 0; bool pausa = true; short auxx; short auxxy; int retraso = 0; short _my = 1; short _mx = 1;
  434. char img[3] = { '>','i','<' };
  435. avispa(short a = 2, short b = 3) {
  436. x = a;
  437. y = b;
  438. };
  439. void moverINI(int limite) {
  440. if (pasos <= 5) {
  441. y++;
  442. }
  443. else if (pasos > 5 && pasos <= limite) {
  444. x--;
  445. }
  446. }
  447. void animar(int limite, int limitex, int variacion) {
  448. if (pasos <= 40) {
  449. auxx = x; auxxy = y;
  450. borrar();
  451. moverINI(limite);
  452. dibujar();
  453. }
  454. else if (pasos>40 && pasos<limitex) {
  455. borrar();
  456. mover2();//circulos
  457. dibujar();
  458. }
  459. else if (pasos >= limitex && pasos<limitex + 20 + (variacion * 50)) {
  460. borrar();
  461. recto();
  462. dibujar();
  463. }
  464. else {
  465. borrar();
  466. aleatorio();
  467. dibujar();
  468. }
  469. pasos++;
  470. retraso++;
  471. }
  472.  
  473. void recto() {
  474. if (y >= 30) {
  475. y = 24;
  476. _my = _my*-1;
  477. }
  478. else if (y <= 10) {
  479. y = 11;
  480. _my = _my*-1;
  481. }
  482. y = y - _my;
  483. }
  484. void mover2() {
  485. if (x <= auxx - 3) {
  486. x = auxx - 3;
  487. mx *= -1;
  488. }
  489. else if (x >= auxx + 3) {
  490. x = auxx + 3;
  491. mx *= -1;
  492. }
  493. else if (y <= auxxy) {
  494. y = auxxy;
  495. my *= -1;
  496. }
  497. else if (y >= auxxy + 6) {
  498. y = auxxy + 6;
  499. my *= -1;
  500. }
  501. y = y + my;
  502. x = x + mx;
  503. }
  504. void aleatorio() {
  505. if (x <= 6) {
  506. x = 7;
  507. _mx *= -1;
  508. }
  509. else if (x >= 95) {
  510. x = 94;
  511. _mx *= -1;
  512. }
  513. else if (y <= 8) {
  514. y = 9;
  515. _my *= -1;
  516. }
  517. else if (y >= 25) {
  518. y = 24;
  519. _my *= -1;
  520. }
  521. y = y + _my;
  522. x = x + _mx;
  523. }
  524. void dibujar() {
  525. Console::SetCursorPosition(x, y);
  526. for (int j = 0; j < 3; j++) {
  527. CambiarColorLetra(ROJO);
  528. cout << img[j];
  529. CambiarColorLetra(BLANCO);
  530. }
  531. }
  532. void borrar() {
  533. Console::SetCursorPosition(x, y);
  534. for (int j = 0; j < 3; j++) {
  535. cout << " ";
  536. }
  537.  
  538. }
  539. };
  540. typedef struct mari {
  541. short x = 10; short y = 10; short mx = 1; short my = 1; int pasos = 0; bool pausa = true; short auxx; short auxxy; short _my = 1; short _mx = 1; int pasos2 = 0;
  542. char img[3] = { '8','i','8' };
  543. mari(short a = 2, short b = 3) {
  544. x = a;
  545. y = b;
  546. };
  547. void moverINI(int limite) {
  548. if (pasos <= 5) {
  549. y++;
  550. }
  551. else if (pasos > 5 && pasos <= limite) {
  552. x++;
  553. }
  554. }
  555. void animar(int limite, int limitex, int variación) {
  556. if (pasos <= 40) {
  557. auxx = x; auxxy = y;
  558. borrar();
  559. moverINI(limite);
  560. dibujar();
  561. }
  562. else if (pasos>40 && pasos<limitex) {
  563. borrar();
  564. mover2();//movimiento en circulo
  565. dibujar();
  566. }
  567. else if (pasos >= limitex && pasos<limitex + 15) {
  568. borrar();
  569. recto();//cae en linea recta
  570. dibujar();
  571. }
  572. else if (pasos >= limitex + 20 && pasos<limitex + 20 + (variación * 50)) {
  573. borrar();
  574. mover3();//aleatorio
  575. dibujar();
  576. }
  577. else {
  578. borrar();
  579. aleatorio();
  580. dibujar();
  581. }
  582. pasos++;
  583. }
  584. void recto() {
  585. y++;
  586. }
  587. void mover2() {
  588. if (x <= auxx - 3) {
  589. x = auxx - 3;
  590. mx *= -1;
  591. }
  592. else if (x >= auxx + 3) {
  593. x = auxx + 3;
  594. mx *= -1;
  595. }
  596. else if (y <= auxxy) {
  597. y = auxxy;
  598. my *= -1;
  599. }
  600. else if (y >= auxxy + 6) {
  601. y = auxxy + 6;
  602. my *= -1;
  603. }
  604. y = y + my;
  605. x = x - mx;
  606. }
  607. void mover3() {
  608. if (x <= 50) {
  609. x = 51;
  610. _mx *= -1;
  611. }
  612. else if (x >= 95) {
  613. x = 94;
  614. _mx *= -1;
  615. }
  616. else if (y <= 5) {
  617. y = 6;
  618. _my *= -1;
  619. }
  620. else if (y >= 30) {
  621. y = 29;
  622. _my *= -1;
  623. }
  624. y = y + _my;
  625. x = x + _mx;
  626. }
  627. void aleatorio() {
  628. if (x <= 8) {
  629. x = 9;
  630. _mx *= -1;
  631. }
  632. else if (x >= 95) {
  633. x = 94;
  634. _mx *= -1;
  635. }
  636. else if (y <= 8) {
  637. y = 9;
  638. _my *= -1;
  639. }
  640. else if (y >= 25) {
  641. y = 24;
  642. _my *= -1;
  643. }
  644. y = y + _my;
  645. x = x + _mx;
  646. }
  647. void dibujar() {
  648. Console::SetCursorPosition(x, y);
  649. for (int j = 0; j < 3; j++) {
  650. CambiarColorLetra(AZUL);
  651. cout << img[j];
  652. CambiarColorLetra(BLANCO);
  653. }
  654. }
  655. void borrar() {
  656. Console::SetCursorPosition(x, y);
  657. for (int j = 0; j < 3; j++) {
  658. cout << " ";
  659. }
  660.  
  661. }
  662. };
  663. typedef struct bala {
  664. short x;
  665. short y;
  666. bool pausa = true;
  667. bala(short a = 2, short b = 3) {
  668. x = a;
  669. y = b;
  670. }
  671. bool colision(short x1, short y1, short ancho, short largo) {
  672. if (x <= x1 + ancho && x + 1 >= x1 && y <= y1 + largo && y + 1 >= y1)
  673. {
  674. return true;
  675. }
  676. return false;
  677. }
  678. void animar() {
  679. if (pausa) {
  680. borrar();
  681. if (y > 0) {
  682. y--;
  683. }
  684. CambiarColorLetra(AMARILLO);
  685. Console::SetCursorPosition(x, y);
  686. cout << "|";
  687. CambiarColorLetra(BLANCO);
  688. }
  689. }
  690. void animar2() {
  691. if (pausa) {
  692. borrar();
  693. if (y <36) {
  694. y++;
  695. }
  696. CambiarColorLetra(ROJO);
  697. Console::SetCursorPosition(x, y);
  698. cout << "*";
  699. CambiarColorLetra(BLANCO);
  700. }
  701. }
  702. void animar3() {
  703. if (pausa) {
  704. borrar();
  705. if (y <36) {
  706. y++;
  707. }
  708. CambiarColorLetra(AZUL);
  709. Console::SetCursorPosition(x, y);
  710. cout << "_";
  711. CambiarColorLetra(BLANCO);
  712. }
  713. }
  714. void borrar() {
  715. Console::SetCursorPosition(x, y);
  716. cout << " ";
  717. }
  718. ~bala() {
  719. Console::SetCursorPosition(x, y);
  720. cout << " ";
  721. }
  722. };
  723. typedef struct comandante {
  724. short x = 10; short y = 10; short mx = 1; short my = 1; int pasos = 0; char img[5] = { '(',')','*','(',')' }; int auxx; int auxy; bala d;
  725. comandante(short _x, short _y) {
  726. x = _x; y = _y;
  727. }
  728. void animar() {
  729. borrar();
  730. mover();
  731. dibujar();
  732. pasos++;
  733. }
  734. void mover() {
  735. if (pasos == 0) {
  736. auxx = x; auxy = y;
  737. }
  738. if (x <= 4 && y>8) {
  739. x = 9;
  740. mx *= -1;
  741. y = y + my;
  742. }
  743. else if (x >= 95 && y<20) {
  744. x = 94;
  745. mx *= -1;
  746. y = y + my;
  747. }
  748. else if (x >= 98 && y >= 20) {
  749. my *= -1;
  750. y = 19;
  751. y = y + my;
  752. mx *= -1;
  753. }
  754. else if (x <= 4 && y <= 8) {
  755. my *= -1;
  756. y = 9;
  757. y = y + my;
  758. mx *= -1;
  759. }
  760. x = x + mx;
  761. pasos++;
  762. }
  763. void dibujar() {
  764. Console::SetCursorPosition(x, y);
  765. for (int j = 0; j < 5; j++) {
  766. CambiarColorLetra(VERDE);
  767. cout << img[j];
  768. CambiarColorLetra(BLANCO);
  769. }
  770. }
  771. void borrar() {
  772. Console::SetCursorPosition(x, y);
  773. for (int j = 0; j < 5; j++) {
  774. cout << " ";
  775. }
  776. }
  777. };
  778.  
  779. typedef struct personaje {
  780. short x;
  781. short y;
  782. int pasos;
  783. char imagen[4][7] = { { ' ',' ',' ','A',' ',' ',' ' },{ ' ',':','M','M','M',':',' ' },{ '<',' ',' ','=',' ',' ','>' },{ '"',' ',' ',' ',' ',' ','"' } };
  784. personaje(short a = 40, short b = 35, short c = 0) {
  785. x = a;
  786. y = b;
  787. pasos = c;
  788. }
  789. void animar(char direccion) {
  790. borrar();
  791. mover(direccion);
  792. dibujar();
  793. }
  794. void dibujar() {
  795. for (int i = 0; i < 4; i++) {
  796. Console::SetCursorPosition(x, y + i);
  797. for (int j = 0; j < 7; j++) {
  798. if (i == 0 && j == 3 || i == 1 && j == 1 || i == 1 && j == 5) {
  799. CambiarColorLetra(ROJO);
  800. CambiarColorFondo(NEGRO);
  801. }
  802. else if (i == 1 && (j == 2 || j == 3 || j == 4)) {
  803. CambiarColorLetra(BLANCO);
  804. CambiarColorFondo(BLANCO);
  805. }
  806. else if (i == 2 && j == 0 || i == 2 && j == 3 || i == 2 && j == 6) {
  807. CambiarColorLetra(AZUL);
  808. CambiarColorFondo(NEGRO);
  809. }
  810. else if (i == 2 && (j == 1 || j == 2 || j == 4 || j == 5)) {
  811. CambiarColorFondo(AZUL);
  812. }
  813. else if (i == 3 && j == 0 || i == 3 && j == 6) {
  814. CambiarColorLetra(AMARILLO);
  815. CambiarColorFondo(NEGRO);
  816. }
  817. else {
  818. CambiarColorLetra(BLANCO);
  819. CambiarColorFondo(NEGRO);
  820. }
  821. cout << imagen[i][j];
  822. }
  823. }
  824. }
  825. void borrar() {
  826. for (int i = 0; i < 4; i++) {
  827. Console::SetCursorPosition(x, y + i);
  828. for (int j = 0; j < 7; j++) {
  829. cout << ' ';
  830. }
  831. }
  832. }
  833. void mover(char direccion) {
  834. switch (toupper(direccion)) {
  835. case IZQUIERDA: if (x>2)x--; pasos++; break;
  836. case DERECHA: if (x<89)x++; pasos++; break;
  837. }
  838. }
  839. };
  840.  
  841. void nivel1() {
  842. personaje* personajeA = new personaje[1];
  843. vector<bala*> disparar; vector<bala*> disparajefe; vector<bala*> haz;
  844. vector<avispa*> avi;
  845. vector<mari*> maripos;
  846. bool continuar = true;
  847. int cantidad = 0; int tiempo = 0; int tiempo1 = 0; short vidas = 3;
  848. avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2));
  849. maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2));
  850.  
  851. //tanda 1 -----------------------------------------------------------------------------------------------------------------------------------------------
  852. while (continuar) {
  853. if (tiempo == 20) {
  854. tiempo = 0;
  855. tiempo1++;;
  856. Console::SetCursorPosition(10, 4);
  857. cout << "TIEMPO: " << tiempo1;
  858. }
  859. Console::SetCursorPosition(85, 4);
  860. cout << "PUNTAJE: " << cantidad;
  861. Console::SetCursorPosition(45, 3);
  862. cout << "TANDA " << 1;
  863. Console::SetCursorPosition(45, 2);
  864. cout << "NIVEL 1";
  865. if (toupper(kbhit())) {
  866. char direccion = getch();
  867. personajeA[0].animar(direccion);
  868. if (direccion == 32) {
  869. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  870. }
  871. }
  872. //inicia movimiento de avispa
  873. for (int l = 0; l < avi.size(); l++) {
  874. avi[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  875. }
  876. //inicia movimiento de mariposa
  877. for (int m = 0; m < maripos.size(); m++) {
  878. maripos[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  879. }
  880. //crea y elimina disparos
  881. for (int i = 0; i < disparar.size(); i++) {
  882. disparar[i]->animar();
  883. if (disparar[i]->y == 2) {
  884. delete disparar[i];
  885. disparar.erase(disparar.begin() + i);
  886. i--;
  887. }
  888. }
  889. for (int j = 0; j < disparar.size(); j++) {
  890. //borra avispa
  891. for (int k = 0; k < avi.size(); k++) {
  892. if (disparar[j]->colision(avi[k]->x, avi[k]->y, 3, 2) && disparar[j]->y>2) {
  893. avi[k]->borrar();
  894. delete avi[k];
  895. avi.erase(avi.begin() + k);
  896. Console::SetCursorPosition(85, 4);
  897. cantidad = cantidad + 100;
  898. cout << "PUNTAJE: " << cantidad;
  899. }
  900. }
  901. //borra mariposa
  902. for (int k = 0; k < maripos.size(); k++) {
  903. if (disparar[j]->colision(maripos[k]->x, maripos[k]->y, 3, 2) && disparar[j]->y>2) {
  904. maripos[k]->borrar();
  905. delete maripos[k];
  906. maripos.erase(maripos.begin() + k);
  907. Console::SetCursorPosition(85, 4);
  908. cantidad = cantidad + 160;
  909. cout << "PUNTAJE: " << cantidad;
  910. }
  911. }
  912. }
  913. if (cantidad == 1040) {
  914. continuar = false;
  915. }
  916. tiempo++;
  917. _sleep(20);
  918. }
  919. //tanda 2 -----------------------------------------------------------------------------------------------------------
  920. bool continuar2 = true;
  921. vector<comandante*> jefe;
  922. vector<mari*> mariposa2;
  923. mariposa2.push_back(new mari(5, 2)); mariposa2.push_back(new mari(5, 2)); mariposa2.push_back(new mari(5, 2)); mariposa2.push_back(new mari(5, 2));
  924. jefe.push_back(new comandante(5, 8));
  925. while (continuar2) {
  926. if (tiempo == 20) {
  927. tiempo = 0;
  928. tiempo1++;;
  929. Console::SetCursorPosition(10, 4);
  930. cout << "TIEMPO: " << tiempo1;
  931. }
  932. Console::SetCursorPosition(85,3);
  933. cout << "VIDAS: " << vidas;
  934. Console::SetCursorPosition(45, 3);
  935. cout << "TANDA " << 2;
  936. Console::SetCursorPosition(45, 2);
  937. cout << "NIVEL 1";
  938. Console::SetCursorPosition(85, 4);
  939. cout << "PUNTAJE: " << cantidad;
  940. if (toupper(kbhit())) {
  941. char direccion = getch();
  942. personajeA[0].animar(direccion);
  943. if (direccion == 32) {
  944. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  945. }
  946. }
  947. //crea y elimina disparos
  948. for (int i = 0; i < disparar.size(); i++) {
  949. disparar[i]->animar();
  950. if (disparar[i]->y == 2) {
  951. delete disparar[i];
  952. disparar.erase(disparar.begin() + i);
  953. i--;
  954. }
  955. }
  956. // anima y elimina las balas del JEFE
  957. for (int f = 0; f < disparajefe.size(); f++) {
  958. disparajefe[f]->animar2();
  959. if (disparajefe[f]->y == 35) {
  960. vidas--;
  961. delete disparajefe[f];
  962. disparajefe.erase(disparajefe.begin() + f);
  963. f--;
  964. }
  965. }
  966. //haz
  967. for (int f = 0; f < haz.size(); f++) {
  968. haz[f]->animar3();
  969. if (personajeA[0].y==haz[f]->y ) {
  970. delete haz[f];
  971. haz.erase(haz.begin() + f);
  972. f--;
  973. }
  974. }
  975. //dibuja mariposa
  976. for (int m = 0; m < mariposa2.size(); m++) {
  977. mariposa2[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  978. }
  979. //dibuja comandantes
  980. for (int i = 0; i < jefe.size(); i++) {
  981. if (personajeA[0].x == jefe[i]->x) {
  982. disparajefe.push_back(new bala(jefe[i]->x, jefe[i]->y));
  983. }
  984. if (jefe[i]->x == 50) {
  985. haz.push_back(new bala(jefe[i]->x, jefe[i]->y));
  986. }
  987. jefe[i]->animar();
  988. }
  989. for (int j = 0; j < disparar.size(); j++) {
  990. //borra mariposa
  991. for (int k = 0; k < mariposa2.size(); k++) {
  992. if (disparar[j]->colision(mariposa2[k]->x, mariposa2[k]->y, 3, 0) && disparar[j]->y > 2) {
  993. mariposa2[k]->borrar();
  994. delete mariposa2[k];
  995. mariposa2.erase(mariposa2.begin() + k);
  996. Console::SetCursorPosition(85, 4);
  997. cantidad = cantidad + 160;
  998. cout << "PUNTAJE: " << cantidad;
  999. }
  1000. }
  1001. //borra acomandante
  1002. for (int k = 0; k < jefe.size(); k++) {
  1003. if (disparar[j]->colision(jefe[k]->x, jefe[k]->y, 3, 0) && disparar[j]->y > 2) {
  1004. jefe[k]->borrar();
  1005. delete jefe[k];
  1006. jefe.erase(jefe.begin() + k);
  1007. Console::SetCursorPosition(85, 4);
  1008. cantidad = cantidad + 400;
  1009. cout << "PUNTAJE: " << cantidad;
  1010. }
  1011. }
  1012. }
  1013. if (vidas == -1) {
  1014. continuar2 = false;
  1015. system("cls");
  1016. perdiste();
  1017. system("pause>0"); break;
  1018. }
  1019. if (cantidad == 2080) {
  1020. continuar2 = false;
  1021. }
  1022. tiempo++;
  1023. _sleep(20);
  1024. }
  1025. // tanda 3-------------------------------------------------------------------------------------------------------------------------------
  1026. bool continuar3 = true;
  1027. vector<mari*> mariposa3;
  1028. mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2));
  1029. mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2));
  1030. while (continuar3) {
  1031. if (tiempo == 20) {
  1032. tiempo = 0; tiempo1++;;
  1033. Console::SetCursorPosition(10, 4);
  1034. cout << "TIEMPO: " << tiempo1;
  1035. }
  1036. Console::SetCursorPosition(85, 3);
  1037. cout << "VIDAS: " << vidas;
  1038. Console::SetCursorPosition(45, 3);
  1039. cout << "TANDA " << 3;
  1040. Console::SetCursorPosition(45, 2);
  1041. cout << "NIVEL 1";
  1042. Console::SetCursorPosition(85, 4);
  1043. cout << "PUNTAJE: " << cantidad;
  1044. if (toupper(kbhit())) {
  1045. char direccion = getch();
  1046. personajeA[0].animar(direccion);
  1047. if (direccion == 32) {
  1048. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1049. }
  1050. }
  1051. //crea y elimina disparos
  1052. for (int i = 0; i < disparar.size(); i++) {
  1053. disparar[i]->animar();
  1054. if (disparar[i]->y == 2) {
  1055. delete disparar[i];
  1056. disparar.erase(disparar.begin() + i);
  1057. i--;
  1058. }
  1059. }
  1060. //dibuja mariposa
  1061. for (int m = 0; m < mariposa3.size(); m++) {
  1062. mariposa3[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1063. }
  1064. for (int j = 0; j < disparar.size(); j++) {
  1065. //borra mariposa
  1066. for (int k = 0; k < mariposa3.size(); k++) {
  1067. if (disparar[j]->colision(mariposa3[k]->x, mariposa3[k]->y, 3, 0) && disparar[j]->y > 2) {
  1068. mariposa3[k]->borrar();
  1069. delete mariposa3[k];
  1070. mariposa3.erase(mariposa3.begin() + k);
  1071. Console::SetCursorPosition(85, 4);
  1072. cantidad = cantidad + 160;
  1073. cout << "PUNTAJE: " << cantidad;
  1074. }
  1075. }
  1076. }
  1077. if (vidas == -1) {
  1078. continuar3 = false;
  1079. system("cls");
  1080. perdiste();
  1081. system("pause>0"); break;
  1082. }
  1083. if (cantidad == 3040) {
  1084. continuar3 = false;
  1085. }
  1086. tiempo++;
  1087. _sleep(20);
  1088. }
  1089. //tanda 4 --------------------------------------------------------------------------------------------------------------
  1090. bool continuar4 = true;
  1091. vector<avispa*> avispas2;
  1092. avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2));
  1093. avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2));
  1094. while (continuar4) {
  1095. if (tiempo == 20) {
  1096. tiempo = 0; tiempo1++;;
  1097. Console::SetCursorPosition(10, 4);
  1098. cout << "TIEMPO: " << tiempo1;
  1099. }
  1100. Console::SetCursorPosition(85, 3);
  1101. cout << "VIDAS: " << vidas;
  1102. Console::SetCursorPosition(45, 3);
  1103. cout << "TANDA " << 4;
  1104. Console::SetCursorPosition(45, 2);
  1105. cout << "NIVEL 1";
  1106. Console::SetCursorPosition(85, 4);
  1107. cout << "PUNTAJE: " << cantidad;
  1108. if (toupper(kbhit())) {
  1109. char direccion = getch();
  1110. personajeA[0].animar(direccion);
  1111. if (direccion == 32) {
  1112. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1113. }
  1114. }
  1115. //crea y elimina disparos
  1116. for (int i = 0; i < disparar.size(); i++) {
  1117. disparar[i]->animar();
  1118. if (disparar[i]->y == 2) {
  1119. delete disparar[i];
  1120. disparar.erase(disparar.begin() + i);
  1121. i--;
  1122. }
  1123. }
  1124. //inicia movimiento de avispa
  1125. for (int l = 0; l < avispas2.size(); l++) {
  1126. avispas2[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  1127. }
  1128.  
  1129. for (int j = 0; j < disparar.size(); j++) {
  1130. //borra avispa
  1131. for (int k = 0; k < avispas2.size(); k++) {
  1132. if (disparar[j]->colision(avispas2[k]->x, avispas2[k]->y, 3, 2) && disparar[j]->y>2) {
  1133. avispas2[k]->borrar();
  1134. delete avispas2[k];
  1135. avispas2.erase(avispas2.begin() + k);
  1136. Console::SetCursorPosition(85, 4);
  1137. cantidad = cantidad + 100;
  1138. cout << "PUNTAJE: " << cantidad;
  1139. }
  1140. }
  1141. }
  1142. if (vidas == -1) {
  1143. continuar4 = false;
  1144. system("cls");
  1145. perdiste();
  1146. system("pause>0"); break;
  1147. }
  1148. if (cantidad == 3640) {
  1149. continuar4 = false;
  1150. }
  1151. tiempo++;
  1152. _sleep(20);
  1153. }
  1154. delete personajeA, avi, disparar, maripos, maripos, jefe,disparajefe,avispas2;
  1155. }
  1156. void nivel2() {
  1157. personaje* personajeA = new personaje[1];
  1158. vector<bala*> disparar; vector<bala*> disparajefe; vector<bala*> haz;
  1159. vector<avispa*> avi;
  1160. vector<mari*> maripos;
  1161. bool continuar = true;
  1162. int cantidad = 0; int tiempo = 0; int tiempo1 = 0; short vidas = 3;
  1163. avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2));
  1164. maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2));
  1165. //tanda 1 -----------------------------------------------------------------------------------------------------------------------------------------------
  1166. while (continuar) {
  1167. if (tiempo == 20) {
  1168. tiempo = 0;
  1169. tiempo1++;;
  1170. Console::SetCursorPosition(10, 4);
  1171. cout << "TIEMPO: " << tiempo1;
  1172. }
  1173. Console::SetCursorPosition(85, 4);
  1174. cout << "PUNTAJE: " << cantidad;
  1175. Console::SetCursorPosition(45, 3);
  1176. cout << "TANDA " << 1;
  1177. Console::SetCursorPosition(45, 2);
  1178. cout << "NIVEL 2";
  1179. if (toupper(kbhit())) {
  1180. char direccion = getch();
  1181. personajeA[0].animar(direccion);
  1182. if (direccion == 32) {
  1183. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1184. }
  1185. }
  1186. //inicia movimiento de avispa
  1187. for (int l = 0; l < avi.size(); l++) {
  1188. avi[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  1189. }
  1190. //inicia movimiento de mariposa
  1191. for (int m = 0; m < maripos.size(); m++) {
  1192. if (maripos[0]) {
  1193. maripos[0]->borrar();
  1194. maripos[0]->aleatorio();
  1195. maripos[0]->dibujar();
  1196. }
  1197. maripos[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1198. }
  1199. //crea y elimina disparos
  1200. for (int i = 0; i < disparar.size(); i++) {
  1201. disparar[i]->animar();
  1202. if (disparar[i]->y == 2) {
  1203. delete disparar[i];
  1204. disparar.erase(disparar.begin() + i);
  1205. i--;
  1206. }
  1207. }
  1208. for (int j = 0; j < disparar.size(); j++) {
  1209. //borra avispa
  1210. for (int k = 0; k < avi.size(); k++) {
  1211. if (disparar[j]->colision(avi[k]->x, avi[k]->y, 3, 2) && disparar[j]->y>2) {
  1212. avi[k]->borrar();
  1213. delete avi[k];
  1214. avi.erase(avi.begin() + k);
  1215. Console::SetCursorPosition(85, 4);
  1216. cantidad = cantidad + 100;
  1217. cout << "PUNTAJE: " << cantidad;
  1218. }
  1219. }
  1220. //borra mariposa
  1221. for (int k = 0; k < maripos.size(); k++) {
  1222. if (disparar[j]->colision(maripos[k]->x, maripos[k]->y, 3, 2) && disparar[j]->y>2) {
  1223. maripos[k]->borrar();
  1224. delete maripos[k];
  1225. maripos.erase(maripos.begin() + k);
  1226. Console::SetCursorPosition(85, 4);
  1227. cantidad = cantidad + 160;
  1228. cout << "PUNTAJE: " << cantidad;
  1229. }
  1230. }
  1231. }
  1232. if (cantidad == 1200) {
  1233. continuar = false;
  1234. }
  1235. tiempo++;
  1236. _sleep(20);
  1237. }
  1238. //tanda 2 -----------------------------------------------------------------------------------------------------------
  1239. bool continuar2 = true;
  1240. vector<comandante*> jefe;
  1241. vector<mari*> mariposa2;
  1242. mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10));
  1243. jefe.push_back(new comandante(5, 10)); jefe.push_back(new comandante(90, 10));
  1244. while (continuar2) {
  1245. if (tiempo == 20) {
  1246. tiempo = 0;
  1247. tiempo1++;;
  1248. Console::SetCursorPosition(10, 4);
  1249. cout << "TIEMPO: " << tiempo1;
  1250. }
  1251. Console::SetCursorPosition(85, 3);
  1252. cout << "VIDAS: " << vidas;
  1253. Console::SetCursorPosition(45, 3);
  1254. cout << "TANDA " << 2;
  1255. Console::SetCursorPosition(45, 2);
  1256. cout << "NIVEL 2";
  1257. Console::SetCursorPosition(85, 4);
  1258. cout << "PUNTAJE: " << cantidad;
  1259. if (toupper(kbhit())) {
  1260. char direccion = getch();
  1261. personajeA[0].animar(direccion);
  1262. if (direccion == 32) {
  1263. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1264. }
  1265. }
  1266. //crea y elimina disparos
  1267. for (int i = 0; i < disparar.size(); i++) {
  1268. disparar[i]->animar();
  1269. if (disparar[i]->y == 2) {
  1270. delete disparar[i];
  1271. disparar.erase(disparar.begin() + i);
  1272. i--;
  1273. }
  1274. }
  1275. // anima y elimina las balas del JEFE
  1276. for (int f = 0; f < disparajefe.size(); f++) {
  1277. disparajefe[f]->animar2();
  1278. if (disparajefe[f]->y == 35) {
  1279. vidas--;
  1280. delete disparajefe[f];
  1281. disparajefe.erase(disparajefe.begin() + f);
  1282. f--;
  1283. }
  1284. }
  1285. //haz
  1286. for (int f = 0; f < haz.size(); f++) {
  1287. haz[f]->animar3();
  1288. if (personajeA[0].y == haz[f]->y) {
  1289. delete haz[f];
  1290. haz.erase(haz.begin() + f);
  1291. f--;
  1292. }
  1293. }
  1294. //dibuja mariposa
  1295. for (int m = 0; m < mariposa2.size(); m++) {
  1296. mariposa2[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1297. }
  1298. //dibuja comandantes
  1299. for (int i = 0; i < jefe.size(); i++) {
  1300. if (personajeA[0].x == jefe[i]->x) {
  1301. disparajefe.push_back(new bala(jefe[i]->x, jefe[i]->y));
  1302. }
  1303. if (jefe[i]->x == 50) {
  1304. haz.push_back(new bala(jefe[i]->x, jefe[i]->y));
  1305. }
  1306. jefe[i]->animar();
  1307. }
  1308. for (int j = 0; j < disparar.size(); j++) {
  1309. //borra mariposa
  1310. for (int k = 0; k < mariposa2.size(); k++) {
  1311. if (disparar[j]->colision(mariposa2[k]->x, mariposa2[k]->y, 3, 0) && disparar[j]->y > 2) {
  1312. mariposa2[k]->borrar();
  1313. delete mariposa2[k];
  1314. mariposa2.erase(mariposa2.begin() + k);
  1315. Console::SetCursorPosition(85, 4);
  1316. cantidad = cantidad + 160;
  1317. cout << "PUNTAJE: " << cantidad;
  1318. }
  1319. }
  1320. //borra acomandante
  1321. for (int k = 0; k < jefe.size(); k++) {
  1322. if (disparar[j]->colision(jefe[k]->x, jefe[k]->y, 3, 0) && disparar[j]->y > 2) {
  1323. jefe[k]->borrar();
  1324. delete jefe[k];
  1325. jefe.erase(jefe.begin() + k);
  1326. Console::SetCursorPosition(85, 4);
  1327. cantidad = cantidad + 400;
  1328. cout << "PUNTAJE: " << cantidad;
  1329. }
  1330. }
  1331. }
  1332. if (vidas == -1) {
  1333. continuar2 = false;
  1334. system("cls");
  1335. perdiste();
  1336. system("pause>0"); break;
  1337. }
  1338. if (cantidad == 2640) {
  1339. continuar2 = false;
  1340. }
  1341. tiempo++;
  1342. _sleep(20);
  1343. }
  1344. // tanda 3-------------------------------------------------------------------------------------------------------------------------------
  1345. bool continuar3 = true;
  1346. vector<mari*> mariposa3; vector<mari*> mariposa31;
  1347. mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2));
  1348. mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10));
  1349. while (continuar3) {
  1350. if (tiempo == 20) {
  1351. tiempo = 0; tiempo1++;;
  1352. Console::SetCursorPosition(10, 4);
  1353. cout << "TIEMPO: " << tiempo1;
  1354. }
  1355. Console::SetCursorPosition(85, 3);
  1356. cout << "VIDAS: " << vidas;
  1357. Console::SetCursorPosition(45, 3);
  1358. cout << "TANDA " << 3;
  1359. Console::SetCursorPosition(45, 2);
  1360. cout << "NIVEL 2";
  1361. Console::SetCursorPosition(85, 4);
  1362. cout << "PUNTAJE: " << cantidad;
  1363. if (toupper(kbhit())) {
  1364. char direccion = getch();
  1365. personajeA[0].animar(direccion);
  1366. if (direccion == 32) {
  1367. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1368. }
  1369. }
  1370. //crea y elimina disparos
  1371. for (int i = 0; i < disparar.size(); i++) {
  1372. disparar[i]->animar();
  1373. if (disparar[i]->y == 2) {
  1374. delete disparar[i];
  1375. disparar.erase(disparar.begin() + i);
  1376. i--;
  1377. }
  1378. }
  1379. //dibuja mariposa
  1380. for (int m = 0; m < mariposa3.size(); m++) {
  1381. mariposa3[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1382. }
  1383. for (int n = 0; n < mariposa31.size(); n++) {
  1384. mariposa31[n]->animar(40 - 7 * n, 90 - 7 * n, n);
  1385. }
  1386.  
  1387. for (int j = 0; j < disparar.size(); j++) {
  1388. //borra mariposa
  1389. for (int k = 0; k < mariposa3.size(); k++) {
  1390. if (disparar[j]->colision(mariposa3[k]->x, mariposa3[k]->y, 3, 0) && disparar[j]->y > 2) {
  1391. mariposa3[k]->borrar();
  1392. delete mariposa3[k];
  1393. mariposa3.erase(mariposa3.begin() + k);
  1394. Console::SetCursorPosition(85, 4);
  1395. cantidad = cantidad + 160;
  1396. cout << "PUNTAJE: " << cantidad;
  1397. }
  1398. }
  1399. for (int l = 0; l < mariposa31.size(); l++) {
  1400. if (disparar[j]->colision(mariposa31[l]->x, mariposa31[l]->y, 3, 0) && disparar[j]->y > 2) {
  1401. mariposa31[l]->borrar();
  1402. delete mariposa31[l];
  1403. mariposa31.erase(mariposa31.begin() + l);
  1404. Console::SetCursorPosition(85, 4);
  1405. cantidad = cantidad + 160;
  1406. cout << "PUNTAJE: " << cantidad;
  1407. }
  1408. }
  1409. }
  1410. if (vidas == -1) {
  1411. continuar3 = false;
  1412. system("cls");
  1413. perdiste();
  1414. system("pause>0"); break;
  1415. }
  1416. if (cantidad == 3920) {
  1417. continuar3 = false;
  1418. }
  1419. tiempo++;
  1420. _sleep(20);
  1421. }
  1422. //tanda 4 --------------------------------------------------------------------------------------------------------------
  1423. bool continuar4 = true;
  1424. vector<avispa*> avispas2; vector<avispa*> avispas21;
  1425. avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2));
  1426. avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12));
  1427. while (continuar4) {
  1428. if (tiempo == 20) {
  1429. tiempo = 0; tiempo1++;;
  1430. Console::SetCursorPosition(10, 4);
  1431. cout << "TIEMPO: " << tiempo1;
  1432. }
  1433. Console::SetCursorPosition(85, 3);
  1434. cout << "VIDAS: " << vidas;
  1435. Console::SetCursorPosition(45, 3);
  1436. cout << "TANDA " << 4;
  1437. Console::SetCursorPosition(45, 2);
  1438. cout << "NIVEL 2";
  1439. Console::SetCursorPosition(85, 4);
  1440. cout << "PUNTAJE: " << cantidad;
  1441. if (toupper(kbhit())) {
  1442. char direccion = getch();
  1443. personajeA[0].animar(direccion);
  1444. if (direccion == 32) {
  1445. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1446. }
  1447. }
  1448. //crea y elimina disparos
  1449. for (int i = 0; i < disparar.size(); i++) {
  1450. disparar[i]->animar();
  1451. if (disparar[i]->y == 2) {
  1452. delete disparar[i];
  1453. disparar.erase(disparar.begin() + i);
  1454. i--;
  1455. }
  1456. }
  1457. //inicia movimiento de avispa
  1458. for (int l = 0; l < avispas2.size(); l++) {
  1459. avispas2[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  1460. }
  1461. for (int n = 0; n < avispas21.size(); n++) {
  1462. avispas21[n]->animar(40 - 7 * n, 90 - 7 * n, n);
  1463. }
  1464. for (int j = 0; j < disparar.size(); j++) {
  1465. //borra avispa
  1466. for (int k = 0; k < avispas2.size(); k++) {
  1467. if (disparar[j]->colision(avispas2[k]->x, avispas2[k]->y, 3, 2) && disparar[j]->y>2) {
  1468. avispas2[k]->borrar();
  1469. delete avispas2[k];
  1470. avispas2.erase(avispas2.begin() + k);
  1471. Console::SetCursorPosition(85, 4);
  1472. cantidad = cantidad + 100;
  1473. cout << "PUNTAJE: " << cantidad;
  1474. }
  1475. }
  1476. for (int c = 0; c < avispas21.size(); c++) {
  1477. if (disparar[j]->colision(avispas21[c]->x, avispas21[c]->y, 3, 2) && disparar[j]->y>2) {
  1478. avispas21[c]->borrar();
  1479. delete avispas21[c];
  1480. avispas21.erase(avispas21.begin() + c);
  1481. Console::SetCursorPosition(85, 4);
  1482. cantidad = cantidad + 100;
  1483. cout << "PUNTAJE: " << cantidad;
  1484. }
  1485. }
  1486. }
  1487. if (vidas == -1) {
  1488. continuar4 = false;
  1489. system("cls");
  1490. perdiste();
  1491. system("pause>0"); break;
  1492. }
  1493. if (cantidad == 4720) {
  1494. continuar4 = false;
  1495. }
  1496. tiempo++;
  1497. _sleep(20);
  1498. }
  1499. delete personajeA, avi, disparar, maripos, maripos, jefe, disparajefe, avispas2;
  1500. }
  1501. void nivel3() {
  1502. personaje* personajeA = new personaje[1];
  1503. vector<bala*> disparar; vector<bala*> disparajefe; vector<bala*> haz;
  1504. vector<avispa*> avi;
  1505. vector<mari*> maripos;
  1506. bool continuar = true;
  1507. int cantidad = 0; int tiempo = 0; int tiempo1 = 0; short vidas = 3;
  1508. avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2));
  1509. maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2));
  1510.  
  1511. //tanda 1 -----------------------------------------------------------------------------------------------------------------------------------------------
  1512. while (continuar) {
  1513. if (tiempo == 20) {
  1514. tiempo = 0;
  1515. tiempo1++;;
  1516. Console::SetCursorPosition(10, 4);
  1517. cout << "TIEMPO: " << tiempo1;
  1518. }
  1519. Console::SetCursorPosition(85, 4);
  1520. cout << "PUNTAJE: " << cantidad;
  1521. Console::SetCursorPosition(45, 3);
  1522. cout << "TANDA " << 1;
  1523. Console::SetCursorPosition(45, 2);
  1524. cout << "NIVEL 3";
  1525. if (toupper(kbhit())) {
  1526. char direccion = getch();
  1527. personajeA[0].animar(direccion);
  1528. if (direccion == 32) {
  1529. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1530. }
  1531. }
  1532. //inicia movimiento de avispa
  1533. for (int l = 0; l < avi.size(); l++) {
  1534. avi[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  1535. }
  1536. //inicia movimiento de mariposa
  1537. for (int m = 0; m < maripos.size(); m++) {
  1538. maripos[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1539. }
  1540. //crea y elimina disparos
  1541. for (int i = 0; i < disparar.size(); i++) {
  1542. disparar[i]->animar();
  1543. if (disparar[i]->y == 2) {
  1544. delete disparar[i];
  1545. disparar.erase(disparar.begin() + i);
  1546. i--;
  1547. }
  1548. }
  1549. for (int j = 0; j < disparar.size(); j++) {
  1550. //borra avispa
  1551. for (int k = 0; k < avi.size(); k++) {
  1552. if (disparar[j]->colision(avi[k]->x, avi[k]->y, 3, 2) && disparar[j]->y>2) {
  1553. avi[k]->borrar();
  1554. delete avi[k];
  1555. avi.erase(avi.begin() + k);
  1556. Console::SetCursorPosition(85, 4);
  1557. cantidad = cantidad + 100;
  1558. cout << "PUNTAJE: " << cantidad;
  1559. }
  1560. }
  1561. //borra mariposa
  1562. for (int k = 0; k < maripos.size(); k++) {
  1563. if (disparar[j]->colision(maripos[k]->x, maripos[k]->y, 3, 2) && disparar[j]->y>2) {
  1564. maripos[k]->borrar();
  1565. delete maripos[k];
  1566. maripos.erase(maripos.begin() + k);
  1567. Console::SetCursorPosition(85, 4);
  1568. cantidad = cantidad + 160;
  1569. cout << "PUNTAJE: " << cantidad;
  1570. }
  1571. }
  1572. }
  1573. if (vidas == -1) {
  1574. continuar = false;
  1575. system("cls");
  1576. perdiste();
  1577. system("pause>0"); break;
  1578. }
  1579. if (cantidad == 1300) {
  1580. continuar = false;
  1581. }
  1582. tiempo++;
  1583. _sleep(20);
  1584. }
  1585. //tanda 2 -----------------------------------------------------------------------------------------------------------
  1586. bool continuar2 = true;
  1587. vector<comandante*> jefe;
  1588. vector<mari*> mariposa2;
  1589. mariposa2.push_back(new mari(5, 2)); mariposa2.push_back(new mari(5, 2)); mariposa2.push_back(new mari(5, 2)); mariposa2.push_back(new mari(5, 2));
  1590. jefe.push_back(new comandante(5, 8)); jefe.push_back(new comandante(95, 8)); jefe.push_back(new comandante(5, 10));
  1591. while (continuar2) {
  1592. if (tiempo == 20) {
  1593. tiempo = 0;
  1594. tiempo1++;;
  1595. Console::SetCursorPosition(10, 4);
  1596. cout << "TIEMPO: " << tiempo1;
  1597. }
  1598. Console::SetCursorPosition(85, 3);
  1599. cout << "VIDAS: " << vidas;
  1600. Console::SetCursorPosition(45, 3);
  1601. cout << "TANDA " << 2;
  1602. Console::SetCursorPosition(45, 2);
  1603. cout << "NIVEL 3";
  1604. Console::SetCursorPosition(85, 4);
  1605. cout << "PUNTAJE: " << cantidad;
  1606. if (toupper(kbhit())) {
  1607. char direccion = getch();
  1608. personajeA[0].animar(direccion);
  1609. if (direccion == 32) {
  1610. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1611. }
  1612. }
  1613. //crea y elimina disparos
  1614. for (int i = 0; i < disparar.size(); i++) {
  1615. disparar[i]->animar();
  1616. if (disparar[i]->y == 2) {
  1617. delete disparar[i];
  1618. disparar.erase(disparar.begin() + i);
  1619. i--;
  1620. }
  1621. }
  1622. // anima y elimina las balas del JEFE
  1623. for (int f = 0; f < disparajefe.size(); f++) {
  1624. disparajefe[f]->animar2();
  1625. if (disparajefe[f]->y == 35) {
  1626. vidas--;
  1627. delete disparajefe[f];
  1628. disparajefe.erase(disparajefe.begin() + f);
  1629. f--;
  1630. }
  1631. }
  1632. //haz
  1633. for (int f = 0; f < haz.size(); f++) {
  1634. haz[f]->animar3();
  1635. if (personajeA[0].y == haz[f]->y) {
  1636. delete haz[f];
  1637. haz.erase(haz.begin() + f);
  1638. f--;
  1639. }
  1640. }
  1641. //dibuja mariposa
  1642. for (int m = 0; m < mariposa2.size(); m++) {
  1643. mariposa2[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1644. }
  1645. //dibuja comandantes
  1646. for (int i = 0; i < jefe.size(); i++) {
  1647. if (personajeA[0].x == jefe[i]->x) {
  1648. disparajefe.push_back(new bala(jefe[i]->x, jefe[i]->y));
  1649. }
  1650. if (jefe[i]->x == 50) {
  1651. haz.push_back(new bala(jefe[i]->x, jefe[i]->y));
  1652. }
  1653. jefe[i]->animar();
  1654. }
  1655. for (int j = 0; j < disparar.size(); j++) {
  1656. //borra mariposa
  1657. for (int k = 0; k < mariposa2.size(); k++) {
  1658. if (disparar[j]->colision(mariposa2[k]->x, mariposa2[k]->y, 3, 0) && disparar[j]->y > 2) {
  1659. mariposa2[k]->borrar();
  1660. delete mariposa2[k];
  1661. mariposa2.erase(mariposa2.begin() + k);
  1662. Console::SetCursorPosition(85, 4);
  1663. cantidad = cantidad + 160;
  1664. cout << "PUNTAJE: " << cantidad;
  1665. }
  1666. }
  1667. //borra acomandante
  1668. for (int k = 0; k < jefe.size(); k++) {
  1669. if (disparar[j]->colision(jefe[k]->x, jefe[k]->y, 3, 0) && disparar[j]->y > 2) {
  1670. jefe[k]->borrar();
  1671. delete jefe[k];
  1672. jefe.erase(jefe.begin() + k);
  1673. Console::SetCursorPosition(85, 4);
  1674. cantidad = cantidad + 400;
  1675. cout << "PUNTAJE: " << cantidad;
  1676. }
  1677. }
  1678. }
  1679. if (vidas == -1) {
  1680. continuar2 = false;
  1681. system("cls");
  1682. perdiste();
  1683. system("pause>0"); break;
  1684. }
  1685. if (cantidad == 3140) {
  1686. continuar2 = false;
  1687. }
  1688. tiempo++;
  1689. _sleep(20);
  1690. }
  1691. // tanda 3-------------------------------------------------------------------------------------------------------------------------------
  1692. bool continuar3 = true;
  1693. vector<mari*> mariposa3;
  1694. mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2));
  1695. mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2)); mariposa3.push_back(new mari(20, 2));
  1696. while (continuar3) {
  1697. if (tiempo == 20) {
  1698. tiempo = 0; tiempo1++;;
  1699. Console::SetCursorPosition(10, 4);
  1700. cout << "TIEMPO: " << tiempo1;
  1701. }
  1702. Console::SetCursorPosition(85, 3);
  1703. cout << "VIDAS: " << vidas;
  1704. Console::SetCursorPosition(45, 3);
  1705. cout << "TANDA " << 3;
  1706. Console::SetCursorPosition(45, 2);
  1707. cout << "NIVEL 3";
  1708. Console::SetCursorPosition(85, 4);
  1709. cout << "PUNTAJE: " << cantidad;
  1710. if (toupper(kbhit())) {
  1711. char direccion = getch();
  1712. personajeA[0].animar(direccion);
  1713. if (direccion == 32) {
  1714. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1715. }
  1716. }
  1717. //crea y elimina disparos
  1718. for (int i = 0; i < disparar.size(); i++) {
  1719. disparar[i]->animar();
  1720. if (disparar[i]->y == 2) {
  1721. delete disparar[i];
  1722. disparar.erase(disparar.begin() + i);
  1723. i--;
  1724. }
  1725. }
  1726. //dibuja mariposa
  1727. for (int m = 0; m < mariposa3.size(); m++) {
  1728. mariposa3[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1729. }
  1730. for (int j = 0; j < disparar.size(); j++) {
  1731. //borra mariposa
  1732. for (int k = 0; k < mariposa3.size(); k++) {
  1733. if (disparar[j]->colision(mariposa3[k]->x, mariposa3[k]->y, 3, 0) && disparar[j]->y > 2) {
  1734. mariposa3[k]->borrar();
  1735. delete mariposa3[k];
  1736. mariposa3.erase(mariposa3.begin() + k);
  1737. Console::SetCursorPosition(85, 4);
  1738. cantidad = cantidad + 160;
  1739. cout << "PUNTAJE: " << cantidad;
  1740. }
  1741. }
  1742. }
  1743. if (vidas == -1) {
  1744. continuar3 = false;
  1745. system("cls");
  1746. perdiste();
  1747. system("pause>0"); break;
  1748. }
  1749. if (cantidad == 4420) {
  1750. continuar3 = false;
  1751. }
  1752. tiempo++;
  1753. _sleep(20);
  1754. }
  1755. //tanda 4 --------------------------------------------------------------------------------------------------------------
  1756. bool continuar4 = true;
  1757. vector<avispa*> avispas2;
  1758. avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2));
  1759. avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2)); avispas2.push_back(new avispa(55, 2));
  1760. while (continuar4) {
  1761. if (tiempo == 20) {
  1762. tiempo = 0; tiempo1++;;
  1763. Console::SetCursorPosition(10, 4);
  1764. cout << "TIEMPO: " << tiempo1;
  1765. }
  1766. Console::SetCursorPosition(85, 3);
  1767. cout << "VIDAS: " << vidas;
  1768. Console::SetCursorPosition(45, 3);
  1769. cout << "TANDA " << 4;
  1770. Console::SetCursorPosition(45, 2);
  1771. cout << "NIVEL 3";
  1772. Console::SetCursorPosition(85, 4);
  1773. cout << "PUNTAJE: " << cantidad;
  1774. if (toupper(kbhit())) {
  1775. char direccion = getch();
  1776. personajeA[0].animar(direccion);
  1777. if (direccion == 32) {
  1778. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1779. }
  1780. }
  1781. //crea y elimina disparos
  1782. for (int i = 0; i < disparar.size(); i++) {
  1783. disparar[i]->animar();
  1784. if (disparar[i]->y == 2) {
  1785. delete disparar[i];
  1786. disparar.erase(disparar.begin() + i);
  1787. i--;
  1788. }
  1789. }
  1790. //inicia movimiento de avispa
  1791. for (int l = 0; l < avispas2.size(); l++) {
  1792. avispas2[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  1793. }
  1794.  
  1795. for (int j = 0; j < disparar.size(); j++) {
  1796. //borra avispa
  1797. for (int k = 0; k < avispas2.size(); k++) {
  1798. if (disparar[j]->colision(avispas2[k]->x, avispas2[k]->y, 3, 2) && disparar[j]->y>2) {
  1799. avispas2[k]->borrar();
  1800. delete avispas2[k];
  1801. avispas2.erase(avispas2.begin() + k);
  1802. Console::SetCursorPosition(85, 4);
  1803. cantidad = cantidad + 100;
  1804. cout << "PUNTAJE: " << cantidad;
  1805. }
  1806. }
  1807. }
  1808. if (vidas == -1) {
  1809. continuar4 = false;
  1810. system("cls");
  1811. perdiste();
  1812. system("pause>0"); break;
  1813. }
  1814. if (cantidad == 5220) {
  1815. continuar4 = false;
  1816. }
  1817. tiempo++;
  1818. _sleep(20);
  1819. }
  1820. delete personajeA, avi, disparar, maripos, jefe, disparajefe, avispas2;
  1821. }
  1822. void nivel4() {
  1823. personaje* personajeA = new personaje[1];
  1824. vector<bala*> disparar; vector<bala*> disparajefe; vector<bala*> haz;
  1825. vector<avispa*> avi;
  1826. vector<mari*> maripos;
  1827. bool continuar = true;
  1828. int cantidad = 0; int tiempo = 0; int tiempo1 = 0; short vidas = 3;
  1829. avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2)); avi.push_back(new avispa(48, 2));
  1830. maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2)); maripos.push_back(new mari(52, 2));
  1831. //tanda 1 -----------------------------------------------------------------------------------------------------------------------------------------------
  1832. while (continuar) {
  1833. if (tiempo == 20) {
  1834. tiempo = 0;
  1835. tiempo1++;;
  1836. Console::SetCursorPosition(10, 4);
  1837. cout << "TIEMPO: " << tiempo1;
  1838. }
  1839. Console::SetCursorPosition(85, 4);
  1840. cout << "PUNTAJE: " << cantidad;
  1841. Console::SetCursorPosition(45, 3);
  1842. cout << "TANDA " << 1;
  1843. Console::SetCursorPosition(45, 2);
  1844. cout << "NIVEL 4";
  1845. if (toupper(kbhit())) {
  1846. char direccion = getch();
  1847. personajeA[0].animar(direccion);
  1848. if (direccion == 32) {
  1849. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1850. }
  1851. }
  1852. //inicia movimiento de avispa
  1853. for (int l = 0; l < avi.size(); l++) {
  1854. if (avi[0]) {
  1855. avi[0]->borrar();
  1856. avi[0]->aleatorio();
  1857. avi[0]->dibujar();
  1858. }
  1859. avi[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  1860. }
  1861. //inicia movimiento de mariposa
  1862. for (int m = 0; m < maripos.size(); m++) {
  1863. if (maripos[0]) {
  1864. maripos[0]->borrar();
  1865. maripos[0]->aleatorio();
  1866. maripos[0]->dibujar();
  1867. }
  1868. maripos[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1869. }
  1870. //crea y elimina disparos
  1871. for (int i = 0; i < disparar.size(); i++) {
  1872. disparar[i]->animar();
  1873. if (disparar[i]->y == 2) {
  1874. delete disparar[i];
  1875. disparar.erase(disparar.begin() + i);
  1876. i--;
  1877. }
  1878. }
  1879. for (int j = 0; j < disparar.size(); j++) {
  1880. //borra avispa
  1881. for (int k = 0; k < avi.size(); k++) {
  1882. if (disparar[j]->colision(avi[k]->x, avi[k]->y, 3, 2) && disparar[j]->y>2) {
  1883. avi[k]->borrar();
  1884. delete avi[k];
  1885. avi.erase(avi.begin() + k);
  1886. Console::SetCursorPosition(85, 4);
  1887. cantidad = cantidad + 100;
  1888. cout << "PUNTAJE: " << cantidad;
  1889. }
  1890. }
  1891. //borra mariposa
  1892. for (int k = 0; k < maripos.size(); k++) {
  1893. if (disparar[j]->colision(maripos[k]->x, maripos[k]->y, 3, 2) && disparar[j]->y>2) {
  1894. maripos[k]->borrar();
  1895. delete maripos[k];
  1896. maripos.erase(maripos.begin() + k);
  1897. Console::SetCursorPosition(85, 4);
  1898. cantidad = cantidad + 160;
  1899. cout << "PUNTAJE: " << cantidad;
  1900. }
  1901. }
  1902. }
  1903. if (cantidad == 1560) {
  1904. continuar = false;
  1905. }
  1906. tiempo++;
  1907. _sleep(20);
  1908. }
  1909. //tanda 2 -----------------------------------------------------------------------------------------------------------
  1910. bool continuar2 = true;
  1911. vector<comandante*> jefe;
  1912. vector<mari*> mariposa2;
  1913. mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10)); mariposa2.push_back(new mari(5, 10));
  1914. jefe.push_back(new comandante(60, 10)); jefe.push_back(new comandante(80, 10)); jefe.push_back(new comandante(70, 13)); jefe.push_back(new comandante(90, 13));
  1915. while (continuar2) {
  1916. if (tiempo == 20) {
  1917. tiempo = 0;
  1918. tiempo1++;;
  1919. Console::SetCursorPosition(10, 4);
  1920. cout << "TIEMPO: " << tiempo1;
  1921. }
  1922. Console::SetCursorPosition(85, 3);
  1923. cout << "VIDAS: " << vidas;
  1924. Console::SetCursorPosition(45, 3);
  1925. cout << "TANDA " << 2;
  1926. Console::SetCursorPosition(45, 2);
  1927. cout << "NIVEL 4";
  1928. Console::SetCursorPosition(85, 4);
  1929. cout << "PUNTAJE: " << cantidad;
  1930. if (toupper(kbhit())) {
  1931. char direccion = getch();
  1932. personajeA[0].animar(direccion);
  1933. if (direccion == 32) {
  1934. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  1935. }
  1936. }
  1937. //crea y elimina disparos
  1938. for (int i = 0; i < disparar.size(); i++) {
  1939. disparar[i]->animar();
  1940. if (disparar[i]->y == 2) {
  1941. delete disparar[i];
  1942. disparar.erase(disparar.begin() + i);
  1943. i--;
  1944. }
  1945. }
  1946. // anima y elimina las balas del JEFE
  1947. for (int f = 0; f < disparajefe.size(); f++) {
  1948. disparajefe[f]->animar2();
  1949. if (disparajefe[f]->y == 35) {
  1950. vidas--;
  1951. delete disparajefe[f];
  1952. disparajefe.erase(disparajefe.begin() + f);
  1953. f--;
  1954. }
  1955. }
  1956. //haz
  1957. for (int f = 0; f < haz.size(); f++) {
  1958. haz[f]->animar3();
  1959. if (personajeA[0].y == haz[f]->y) {
  1960. delete haz[f];
  1961. haz.erase(haz.begin() + f);
  1962. f--;
  1963. }
  1964. }
  1965. //dibuja mariposa
  1966. for (int m = 0; m < mariposa2.size(); m++) {
  1967. mariposa2[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  1968. }
  1969. //dibuja comandantes
  1970. for (int i = 0; i < jefe.size(); i++) {
  1971. if (personajeA[0].x == jefe[i]->x) {
  1972. disparajefe.push_back(new bala(jefe[i]->x, jefe[i]->y));
  1973. }
  1974. if (jefe[i]->x == 50) {
  1975. haz.push_back(new bala(jefe[i]->x, jefe[i]->y));
  1976. }
  1977. jefe[i]->animar();
  1978. }
  1979. for (int j = 0; j < disparar.size(); j++) {
  1980. //borra mariposa
  1981. for (int k = 0; k < mariposa2.size(); k++) {
  1982. if (disparar[j]->colision(mariposa2[k]->x, mariposa2[k]->y, 3, 0) && disparar[j]->y > 2) {
  1983. mariposa2[k]->borrar();
  1984. delete mariposa2[k];
  1985. mariposa2.erase(mariposa2.begin() + k);
  1986. Console::SetCursorPosition(85, 4);
  1987. cantidad = cantidad + 160;
  1988. cout << "PUNTAJE: " << cantidad;
  1989. }
  1990. }
  1991. //borra acomandante
  1992. for (int k = 0; k < jefe.size(); k++) {
  1993. if (disparar[j]->colision(jefe[k]->x, jefe[k]->y, 3, 0) && disparar[j]->y > 2) {
  1994. jefe[k]->borrar();
  1995. delete jefe[k];
  1996. jefe.erase(jefe.begin() + k);
  1997. Console::SetCursorPosition(85, 4);
  1998. cantidad = cantidad + 400;
  1999. cout << "PUNTAJE: " << cantidad;
  2000. }
  2001. }
  2002. }
  2003. if (vidas == -1) {
  2004. continuar2 = false;
  2005. system("cls");
  2006. perdiste();
  2007. system("pause>0"); break;
  2008. }
  2009. if (cantidad == 3960) {
  2010. continuar2 = false;
  2011. }
  2012. tiempo++;
  2013. _sleep(20);
  2014. }
  2015. // tanda 3-------------------------------------------------------------------------------------------------------------------------------
  2016. bool continuar3 = true;
  2017. vector<mari*> mariposa3; vector<mari*> mariposa31;
  2018. mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2)); mariposa3.push_back(new mari(10, 2));
  2019. mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10)); mariposa31.push_back(new mari(10, 10));
  2020. while (continuar3) {
  2021. if (tiempo == 20) {
  2022. tiempo = 0; tiempo1++;;
  2023. Console::SetCursorPosition(10, 4);
  2024. cout << "TIEMPO: " << tiempo1;
  2025. }
  2026. Console::SetCursorPosition(85, 3);
  2027. cout << "VIDAS: " << vidas;
  2028. Console::SetCursorPosition(45, 3);
  2029. cout << "TANDA " << 3;
  2030. Console::SetCursorPosition(45, 2);
  2031. cout << "NIVEL 4";
  2032. Console::SetCursorPosition(85, 4);
  2033. cout << "PUNTAJE: " << cantidad;
  2034. if (toupper(kbhit())) {
  2035. char direccion = getch();
  2036. personajeA[0].animar(direccion);
  2037. if (direccion == 32) {
  2038. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  2039. }
  2040. }
  2041. //crea y elimina disparos
  2042. for (int i = 0; i < disparar.size(); i++) {
  2043. disparar[i]->animar();
  2044. if (disparar[i]->y == 2) {
  2045. delete disparar[i];
  2046. disparar.erase(disparar.begin() + i);
  2047. i--;
  2048. }
  2049. }
  2050. //dibuja mariposa
  2051. for (int m = 0; m < mariposa3.size(); m++) {
  2052. mariposa3[m]->animar(40 - 7 * m, 90 - 7 * m, m);
  2053. }
  2054. for (int n = 0; n < mariposa31.size(); n++) {
  2055. mariposa31[n]->animar(40 - 7 * n, 90 - 7 * n, n);
  2056. }
  2057.  
  2058. for (int j = 0; j < disparar.size(); j++) {
  2059. //borra mariposa
  2060. for (int k = 0; k < mariposa3.size(); k++) {
  2061. if (disparar[j]->colision(mariposa3[k]->x, mariposa3[k]->y, 3, 0) && disparar[j]->y > 2) {
  2062. mariposa3[k]->borrar();
  2063. delete mariposa3[k];
  2064. mariposa3.erase(mariposa3.begin() + k);
  2065. Console::SetCursorPosition(85, 4);
  2066. cantidad = cantidad + 160;
  2067. cout << "PUNTAJE: " << cantidad;
  2068. }
  2069. }
  2070. for (int l = 0; l < mariposa31.size(); l++) {
  2071. if (disparar[j]->colision(mariposa31[l]->x, mariposa31[l]->y, 3, 0) && disparar[j]->y > 2) {
  2072. mariposa31[l]->borrar();
  2073. delete mariposa31[l];
  2074. mariposa31.erase(mariposa31.begin() + l);
  2075. Console::SetCursorPosition(85, 4);
  2076. cantidad = cantidad + 160;
  2077. cout << "PUNTAJE: " << cantidad;
  2078. }
  2079. }
  2080. }
  2081. if (vidas == -1) {
  2082. continuar3 = false;
  2083. system("cls");
  2084. perdiste();
  2085. system("pause>0"); break;
  2086. }
  2087. if (cantidad == 5560) {
  2088. continuar3 = false;
  2089. }
  2090. tiempo++;
  2091. _sleep(20);
  2092. }
  2093. //tanda 4 --------------------------------------------------------------------------------------------------------------
  2094. bool continuar4 = true;
  2095. vector<avispa*> avispas2; vector<avispa*> avispas21;
  2096. avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2)); avispas2.push_back(new avispa(80, 2));
  2097. avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12)); avispas21.push_back(new avispa(80, 12));
  2098. while (continuar4) {
  2099. if (tiempo == 20) {
  2100. tiempo = 0; tiempo1++;;
  2101. Console::SetCursorPosition(10, 4);
  2102. cout << "TIEMPO: " << tiempo1;
  2103. }
  2104. Console::SetCursorPosition(85, 3);
  2105. cout << "VIDAS: " << vidas;
  2106. Console::SetCursorPosition(45, 3);
  2107. cout << "TANDA " << 4;
  2108. Console::SetCursorPosition(45, 2);
  2109. cout << "NIVEL 4";
  2110. Console::SetCursorPosition(85, 4);
  2111. cout << "PUNTAJE: " << cantidad;
  2112. if (toupper(kbhit())) {
  2113. char direccion = getch();
  2114. personajeA[0].animar(direccion);
  2115. if (direccion == 32) {
  2116. disparar.push_back(new bala(personajeA->x + 3, personajeA->y - 1));
  2117. }
  2118. }
  2119. //crea y elimina disparos
  2120. for (int i = 0; i < disparar.size(); i++) {
  2121. disparar[i]->animar();
  2122. if (disparar[i]->y == 2) {
  2123. delete disparar[i];
  2124. disparar.erase(disparar.begin() + i);
  2125. i--;
  2126. }
  2127. }
  2128. //inicia movimiento de avispa
  2129. for (int l = 0; l < avispas2.size(); l++) {
  2130. avispas2[l]->animar(40 - 7 * l, 90 - 7 * l, l);
  2131. }
  2132. for (int n = 0; n < avispas21.size(); n++) {
  2133. avispas21[n]->animar(40 - 7 * n, 90 - 7 * n, n);
  2134. }
  2135. for (int j = 0; j < disparar.size(); j++) {
  2136. //borra avispa
  2137. for (int k = 0; k < avispas2.size(); k++) {
  2138. if (disparar[j]->colision(avispas2[k]->x, avispas2[k]->y, 3, 2) && disparar[j]->y>2) {
  2139. avispas2[k]->borrar();
  2140. delete avispas2[k];
  2141. avispas2.erase(avispas2.begin() + k);
  2142. Console::SetCursorPosition(85, 4);
  2143. cantidad = cantidad + 100;
  2144. cout << "PUNTAJE: " << cantidad;
  2145. }
  2146. }
  2147. for (int c = 0; c < avispas21.size(); c++) {
  2148. if (disparar[j]->colision(avispas21[c]->x, avispas21[c]->y, 3, 2) && disparar[j]->y>2) {
  2149. avispas21[c]->borrar();
  2150. delete avispas21[c];
  2151. avispas21.erase(avispas21.begin() + c);
  2152. Console::SetCursorPosition(85, 4);
  2153. cantidad = cantidad + 100;
  2154. cout << "PUNTAJE: " << cantidad;
  2155. }
  2156. }
  2157. }
  2158. if (vidas == -1) {
  2159. continuar3 = false;
  2160. system("cls");
  2161. perdiste();
  2162. system("pause>0"); break;
  2163. }
  2164. if (cantidad == 6560) {
  2165. continuar4 = false;
  2166. system("cls");
  2167. ganaste();
  2168. }
  2169. tiempo++;
  2170. _sleep(20);
  2171. }
  2172. delete personajeA, avi, disparar, maripos, maripos, jefe, disparajefe, avispas2;
  2173. }
  2174. void main() {
  2175. Console::CursorVisible = false;
  2176. Console::SetWindowSize(110, 42);
  2177. galaga(); system("cls");
  2178. instrucciones(); system("cls");
  2179. level1(); system("cls");
  2180. marco();
  2181. nivel1(); system("cls");
  2182. level2(); system("cls");
  2183. marco();
  2184. nivel2(); system("cls");
  2185. level3(); system("cls");
  2186. marco();
  2187. nivel3(); system("cls");
  2188. level4(); system("cls");
  2189. marco();
  2190. nivel4(); system("cls");
  2191. return;
  2192. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement