Advertisement
Mauriciocaradenepe

hito 3

Jun 26th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include "mapas.hpp"
  4. #define FILAS 24
  5. #define COLUMNAS 80
  6. #define IZQUIERDA 75
  7. #define DERECHA 77
  8. #define ARRIBA 72
  9. #define ABAJO 80
  10. using namespace std;
  11. using namespace System;
  12.  
  13. void pintarT(int x, int y) {
  14. Console::SetCursorPosition(x, y); Console::ForegroundColor = ConsoleColor::DarkRed; cout << (char)219 << (char)219 << (char)219 << (char)219 << (char)219 << (char)219 << (char)219;
  15.  
  16.  
  17. }
  18. void borrar(int x, int y) {
  19. Console::SetCursorPosition(x, y);
  20. Console::BackgroundColor = ConsoleColor::Cyan; cout << " ";
  21. }
  22. void dibujo(int nivel[FILAS][COLUMNAS]) {
  23. for (int cf = 0; cf < FILAS; cf++)
  24. {
  25. for (int cc = 0; cc < COLUMNAS; cc++)
  26. {
  27. Console::SetCursorPosition(cc, cf);
  28. switch (nivel[cf][cc])
  29. {
  30. case 0:Console::ForegroundColor = ConsoleColor::White; cout << (char)219; break;
  31. case 1:Console::ForegroundColor = ConsoleColor::Magenta; cout << (char)219; break;
  32. case 2:Console::ForegroundColor = ConsoleColor::DarkYellow; cout << (char)219; break;
  33. case 3:Console::ForegroundColor = ConsoleColor::Cyan; cout << (char)219; break;
  34. case 4:Console::ForegroundColor = ConsoleColor::DarkRed; cout << (char)219; break;
  35. case 5:Console::ForegroundColor = ConsoleColor::DarkGray; cout << (char)219; break;
  36. case 6:Console::ForegroundColor = ConsoleColor::Gray; cout << (char)219; break;
  37. case 7:Console::ForegroundColor = ConsoleColor::DarkMagenta; cout << (char)219; break;
  38. case 8:Console::ForegroundColor = ConsoleColor::Green; cout << (char)219; break;
  39. case 9:Console::ForegroundColor = ConsoleColor::Blue; cout << (char)219; break;
  40. case 10:Console::ForegroundColor = ConsoleColor::Red; cout << (char)219; break;
  41. case 11:Console::ForegroundColor = ConsoleColor::DarkGreen; cout << (char)219; break;
  42. case 20:Console::ForegroundColor = ConsoleColor::DarkCyan; cout << (char)219; break;
  43. case 21:Console::ForegroundColor = ConsoleColor::DarkCyan; cout << (char)219; break;
  44. }
  45. }
  46. }
  47.  
  48. }
  49. void pintaPer() {
  50. Console::ForegroundColor = ConsoleColor::White; cout << (char)219; cout << (char)219;
  51. }
  52. int main() {
  53. repite:
  54. int i = 0;
  55. int x = 2;
  56. int y = 4;
  57. int w = 2;
  58. int z = 2;
  59. dibujo(lvl1);
  60. while (i<68)
  61. {
  62. _sleep(100);
  63. borrar(x, y);
  64. pintarT(x + 1, y);
  65.  
  66. if (i<64)
  67. {
  68. borrar(w, y);
  69. pintarT(w + 1, y);
  70. w++;
  71.  
  72. }
  73. if (i<57)
  74. {
  75. borrar(z, y);
  76. pintarT(z + 1, y);
  77. z++;
  78. }
  79. x++;
  80. ++i;
  81. }
  82.  
  83.  
  84. goto repite;
  85. cin.get();
  86. return 0;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement