Advertisement
alfarovivecrj

TF

Jun 25th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 30.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <windows.h>
  4. using namespace std;
  5. using namespace System;
  6. void Dibujar_mapa(int **mapa, int nf, int nc)
  7. {
  8.     for (int i = 0; i<nf; i++)
  9.     {
  10.         for (int k = 0; k<nc; k++)
  11.         {
  12.             if (mapa[i][k] == 1)
  13.             {
  14.                 Console::SetCursorPosition(k, i);
  15.                 Console::ForegroundColor = ConsoleColor::DarkRed;
  16.                 cout << char(219);
  17.             }
  18.             if (mapa[i][k] == 2)
  19.             {
  20.                 Console::SetCursorPosition(k, i);
  21.                 Console::ForegroundColor = ConsoleColor::Black;
  22.                 cout << char(219);
  23.             }
  24.             if (mapa[i][k] == 3)
  25.             {
  26.                 Console::SetCursorPosition(k, i);
  27.                 Console::ForegroundColor = ConsoleColor::White;
  28.                 cout << char(219);
  29.             }
  30.         }
  31.     }
  32. }
  33. void Mapa1(int **mapa, int nf, int nc)
  34. {
  35.     int matriz[20][70] = { { 1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1 },
  36.     { 1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2 },
  37.     { 1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1 },
  38.     { 1,1,1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,1,1,1,2,1 },
  52.     { 1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1 },
  53.     { 1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1 },
  54.     { 1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1 } };
  55.  
  56.     ;
  57.     for (int i = 0; i<nf; i++)
  58.         for (int j = 0; j<nc; j++)
  59.             mapa[i][j] = matriz[i][j];
  60.     Dibujar_mapa(mapa, nf, nc);
  61. }
  62. void Mapa2(int **mapa, int nf, int nc)
  63. {
  64.     int matriz[20][70] = { { 1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,2,2,1,2,1,2,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2 },
  65.     { 2,1,2,1,2,1,1,1,2,2,2,2,2,2,1,1,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,1,1,2,2,2,2,2,2,1,1,1,1,2,2,1,2,2,2,1,2,2,1,1,1,1,1,2,2,2,2,2,2,1,1,2,1,2,1 },
  66.     { 2,1,1,1,2,1,1,2,2,1,1,1,1,2,2,1,1,2,2,2,2,2,2,1,1,2,2,2,2,2,2,1,1,2,2,1,1,1,1,2,2,1,1,1,1,2,2,1,2,1,2,2,1,1,1,1,1,2,2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,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2 },
  81.     { 2,1,2,2,2,2,1,1,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,1,2,2 },
  82.     { 2,1,2,2,2,1,2,2,1,2,2,2,1,2,2,2,1,2,2,1,2,2,2,1,2,2,2,1,2,2,1,2,2,2,1,2,2,2,1,2,2,1,2,2,2,1,2,2,2,1,2,2,1,2,2,2,1,2,2,2,1,2,2,1,2,2,2,1,2,2 },
  83.     { 2,1,2,2,1,1,2,2,1,1,2,2,1,2,2,1,1,2,2,1,1,2,2,1,2,2,1,1,2,2,1,1,2,2,1,2,2,1,1,2,2,1,1,2,2,1,2,2,1,1,2,2,1,1,2,2,1,2,2,1,1,2,2,1,1,2,2,1,2,2 } };
  84.     ;
  85.     for (int i = 0; i<nf; i++)
  86.         for (int j = 0; j<nc; j++)
  87.             mapa[i][j] = matriz[i][j];
  88.     Dibujar_mapa(mapa, nf, nc);
  89. }
  90. void Mapa3(int **mapa, int nf, int nc)
  91. {
  92.     int matriz[20][70] = { { 1,1,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,1,1 },
  93.     { 1,1,2,2,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,2,2,1,1 },
  94.     { 1,1,2,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,2,2,1,1 },
  109.     { 1,1,2,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,2,1,1 },
  110.     { 1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1 },
  111.     { 1,1,1,2,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,1,1,1 } };
  112.     ;
  113.     ;
  114.     for (int i = 0; i<nf; i++)
  115.         for (int j = 0; j<nc; j++)
  116.             mapa[i][j] = matriz[i][j];
  117.     Dibujar_mapa(mapa, nf, nc);
  118. }
  119. void Mapa4(int **mapa, int nf, int nc)
  120. {
  121.     int matriz[20][70] = { { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1 },
  122.     { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1 },
  123.     { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,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1,1,2,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  138.     { 1,1,1,1,1,1,2,2,1,1,1,2,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  139.     { 1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  140.     { 1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } };
  141.         for (int i = 0; i<nf; i++)
  142.         for (int j = 0; j<nc; j++)
  143.             mapa[i][j] = matriz[i][j];
  144.     Dibujar_mapa(mapa, nf, nc);
  145. }
  146. void Mapa5(int **mapa, int nf, int nc)
  147. {
  148.     int matriz[20][70] = { { 1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1 },
  149.     { 2,1,2,2,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,2,2,1,1,1 },
  150.     { 2,1,2,1,1,1,1,2,1,2,1,1,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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  165.     { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  166.     { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  167.     { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } };
  168.     ;
  169.     for (int i = 0; i<nf; i++)
  170.         for (int j = 0; j<nc; j++)
  171.             mapa[i][j] = matriz[i][j];
  172.     Dibujar_mapa(mapa, nf, nc);
  173. }
  174. void Mapa6(int **mapa, int nf, int nc)
  175. {
  176.     int matriz[20][70] = { { 1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1 },
  177.     { 1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,2,2,1,1,1,2,1,1,1,2,2,1,1,1,1,1,1,1,2,2,1,1,1,1 },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,1,1,1,1,1,1,1,1,1,1,1 },
  192.     { 1,2,2,1,2,1,2,2,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  193.     { 1,2,1,1,2,1,1,2,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  194.     { 2,2,2,2,2,2,2,2,2,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  195.     { 1,2,1,1,2,1,1,2,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } };
  196.     ;
  197.     for (int i = 0; i<nf; i++)
  198.         for (int j = 0; j<nc; j++)
  199.             mapa[i][j] = matriz[i][j];
  200.     Dibujar_mapa(mapa, nf, nc);
  201. }
  202. void Mapa7(int **mapa, int nf, int nc)
  203. {
  204.     int matriz[20][70] = { { 1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1 },
  205.     { 1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,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1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2 },
  220.     { 2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1 },
  221.     { 1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1 },
  222.     { 1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1 },
  223.     { 1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1 } };
  224.  
  225.     for (int i = 0; i<nf; i++)
  226.         for (int j = 0; j<nc; j++)
  227.             mapa[i][j] = matriz[i][j];
  228.     Dibujar_mapa(mapa, nf, nc);
  229. }
  230. void Mapa8(int **mapa, int nf, int nc)
  231. {
  232.     int matriz[20][70] = { { 2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  233.     { 1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1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,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1 },
  248.     { 2,1,1,2,2,1,1,1,2,2,1,1,1,1,1,2,2,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1 },
  249.     { 1,1,2,2,1,1,1,1,1,2,2,1,1,1,2,2,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2 },
  250.     { 1,2,2,1,1,1,1,1,1,1,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2 },
  251.     { 2,2,1,1,1,1,1,1,1,1,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2 } };
  252.  
  253.     for (int i = 0; i<nf; i++)
  254.         for (int j = 0; j<nc; j++)
  255.             mapa[i][j] = matriz[i][j];
  256.     Dibujar_mapa(mapa, nf, nc);
  257. }
  258.  
  259.  
  260. void borrarpersonaje(int x, int y)
  261. {
  262.     Console::SetCursorPosition(x, y);
  263.     cout << " ";
  264.     Console::SetCursorPosition(x+2, y);
  265.     cout << " ";
  266.     Console::SetCursorPosition(x + 1, y + 1);
  267.     cout << " ";
  268.     Console::SetCursorPosition(x, y + 1);
  269.     cout << " ";
  270.     Console::SetCursorPosition(x, y + 2);
  271.     cout << " ";
  272.     Console::SetCursorPosition(x + 1, y + 2);
  273.     cout << " ";
  274.     Console::SetCursorPosition(x + 2, y + 2);
  275.     cout << " ";
  276.     Console::SetCursorPosition(x + 2, y + 1);
  277.     cout << " ";
  278.     Console::SetCursorPosition(x + 1, y);
  279.     cout << " ";
  280. }
  281.  
  282. void pintar_limites()
  283. {
  284.     for (int i = 0;i < 71;i++)
  285.     {
  286.         Console::SetCursorPosition(i, 0);Console::ForegroundColor = ConsoleColor::Black; cout << char(219);
  287.         Console::SetCursorPosition(i, 20);Console::ForegroundColor = ConsoleColor::Black;cout << char(219);
  288.     }
  289.     for (int i = 0; i < 21;i++)
  290.     {
  291.         Console::SetCursorPosition(70, i);Console::ForegroundColor = ConsoleColor::Black;cout << char(219);
  292.     }
  293. }
  294.  
  295. void dibujarpersonaje(int x, int y)
  296. {
  297.     Console::SetCursorPosition(x, y);
  298.     Console::BackgroundColor = ConsoleColor::DarkRed;
  299.     Console::ForegroundColor = ConsoleColor::Black;
  300.     cout << char(219);
  301.     Console::SetCursorPosition(x +2, y);
  302.     Console::BackgroundColor = ConsoleColor::DarkRed;
  303.     Console::ForegroundColor = ConsoleColor::Black;
  304.     cout << char(219);
  305.     Console::SetCursorPosition(x + 1, y+1);
  306.     Console::BackgroundColor = ConsoleColor::DarkRed;
  307.     Console::ForegroundColor = ConsoleColor::Black;
  308.     cout << char(219);
  309.     Console::SetCursorPosition(x , y + 1);
  310.     Console::BackgroundColor = ConsoleColor::DarkRed;
  311.     Console::ForegroundColor = ConsoleColor::DarkGreen;
  312.     cout << char(219);
  313.     Console::SetCursorPosition(x, y + 2);
  314.     Console::BackgroundColor = ConsoleColor::DarkRed;
  315.     Console::ForegroundColor = ConsoleColor::DarkGreen;
  316.     cout << char(219);
  317.     Console::SetCursorPosition(x+1, y + 2);
  318.     Console::BackgroundColor = ConsoleColor::DarkRed;
  319.     Console::ForegroundColor = ConsoleColor::Black;
  320.     cout << char(219);
  321.     Console::SetCursorPosition(x + 2, y + 2);
  322.     Console::BackgroundColor = ConsoleColor::DarkRed;
  323.     Console::ForegroundColor = ConsoleColor::DarkGreen;
  324.     cout << char(219);
  325.     Console::SetCursorPosition(x + 2, y + 1);
  326.     Console::BackgroundColor = ConsoleColor::DarkRed;
  327.     Console::ForegroundColor = ConsoleColor::DarkGreen;
  328.     cout << char(219);
  329.     Console::SetCursorPosition(x + 1, y );
  330.     Console::BackgroundColor = ConsoleColor::DarkRed;
  331.     Console::ForegroundColor = ConsoleColor::DarkGreen;
  332.     cout << char(219);
  333. }
  334.  
  335. void moverpersonaje(int &x, int &y, int dx, int dy, int **matriz)
  336. {
  337.     dx = dy = 0;
  338.     if (_kbhit())
  339.     {
  340.         char teclapresionada = _getch();
  341.         teclapresionada = toupper(teclapresionada);
  342.         switch (teclapresionada)
  343.         {
  344.         case 72:  dy = -1; dx = 0; break;
  345.         case 80:  dy = 1;  dx = 0; break;
  346.         case 75:  dx = -1; dy = 0; break;
  347.         case 77: dx = 1;  dy = 0;
  348.         }
  349.     }
  350.     //1
  351.     if (x + dx < 0 || x + dx>69 || (matriz[y][x + dx] == 2) )
  352.     {
  353.         dx = 0;
  354.     }
  355.  
  356.     if (y + dy < 0 || y + dy>19|| (matriz[y + dy][x] == 2))
  357.     {
  358.         dy = 0;
  359.     }
  360.     //2
  361.     if (x+2 + dx < 0 || x+2 + dx>69 || (matriz[y][x+2 + dx] == 2))
  362.     {
  363.         dx = 0;
  364.     }
  365.  
  366.     if (y + dy < 0 || y + dy>19|| (matriz[y + dy][x+2] == 2))
  367.     {
  368.         dy = 0;
  369.     }
  370.     //3
  371.     if (x + 1 + dx < 0 || x + 1 + dx>69 || (matriz[y+1][x + 1 + dx] == 2))
  372.     {
  373.         dx = 0;
  374.     }
  375.  
  376.     if (y+1 + dy < 0 || y+1 + dy>19 || (matriz[y+1 + dy][x + 1] == 2))
  377.     {
  378.         dy = 0;
  379.     }
  380.     //4
  381.     if (x  + dx < 0 || x  + dx>69 || (matriz[y + 1][x + dx] == 2))
  382.     {
  383.         dx = 0;
  384.     }
  385.  
  386.     if (y + 1 + dy < 0 || y + 1 + dy>19 || (matriz[y + 1 + dy][x ] == 2))
  387.     {
  388.         dy = 0;
  389.     }
  390.     //5
  391.     if (x + dx < 0 || x + dx>69 || (matriz[y + 2][x + dx] == 2))
  392.     {
  393.         dx = 0;
  394.     }
  395.  
  396.     if (y + 2 + dy < 0 || y + 2 + dy>19 || (matriz[y + 2 + dy][x] == 2))
  397.     {
  398.         dy = 0;
  399.     }
  400.     //6
  401.     if (x+1 + dx < 0 || x+1 + dx>69 || (matriz[y + 2][x+1 + dx] == 2))
  402.     {
  403.         dx = 0;
  404.     }
  405.  
  406.     if (y + 2 + dy < 0 || y + 2 + dy>19 || (matriz[y + 2 + dy][x+1] == 2))
  407.     {
  408.         dy = 0;
  409.     }
  410.     //7
  411.     if (x + 2 + dx < 0 || x + 2 + dx>69|| (matriz[y + 2][x + 2 + dx] == 2))
  412.     {
  413.         dx = 0;
  414.     }
  415.  
  416.     if (y + 2 + dy < 0 || y + 2 + dy>19|| (matriz[y + 2 + dy][x + 2] == 2))
  417.     {
  418.         dy = 0;
  419.     }
  420.     //8
  421.     if (x + 2 + dx < 0 || x + 2 + dx>69|| (matriz[y + 1][x + 2 + dx] == 2))
  422.     {
  423.         dx = 0;
  424.     }
  425.  
  426.     if (y + 1+ dy < 0 || y + 1 + dy>19|| (matriz[y + 1 + dy][x + 2] == 2))
  427.     {
  428.         dy = 0;
  429.     }
  430.     //9
  431.     if (x + 1 + dx < 0 || x + 1 + dx>69 || (matriz[y ][x + 1 + dx] == 2))
  432.     {
  433.         dx = 0;
  434.     }
  435.  
  436.     if (y  + dy < 0 || y  + dy>19|| (matriz[y  + dy][x + 1] == 2))
  437.     {
  438.         dy = 0;
  439.     }
  440.     x = x + dx;
  441.     y = y + dy;
  442.     dibujarpersonaje(x, y);
  443.     Sleep(30);//retardo
  444.     borrarpersonaje(x, y);
  445. }
  446.  
  447. void controlador(int &xpersonaje, int &ypersonaje, int dx, int dy, int ** matriz)
  448. {
  449.     while (1)
  450.         moverpersonaje(xpersonaje, ypersonaje, dx, dy, matriz);
  451. }
  452.  
  453. void main()
  454. {
  455.     Console::SetWindowSize(80, 26);
  456.     Console::CursorVisible = false;
  457.     int **mapa;
  458.     int **matriz, xpersonaje, ypersonaje, dx, dy;
  459.     int  nf, nc;
  460.     matriz = new int*[25];
  461.     for (int i = 0; i<25; i++)
  462.         matriz[i] = new int[80];
  463.     xpersonaje = 66;
  464.     ypersonaje = 9;
  465.     dx = dy = 0;
  466.     nf = 20;
  467.     nc = 70;
  468.     mapa = new int*[nf];
  469.     for (int i = 0; i<nf; i++)
  470.         mapa[i] = new int[nc];
  471.     Mapa1(mapa, nf, nc);
  472.     pintar_limites();
  473.     controlador(xpersonaje, ypersonaje, dx, dy, mapa);
  474.     _getch();
  475. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement