Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <windows.h>
- using namespace std;
- using namespace System;
- void Dibujar_mapa(int **mapa, int nf, int nc)
- {
- for (int i = 0; i<nf; i++)
- {
- for (int k = 0; k<nc; k++)
- {
- if (mapa[i][k] == 1)
- {
- Console::SetCursorPosition(k, i);
- Console::ForegroundColor = ConsoleColor::DarkRed;
- cout << char(219);
- }
- if (mapa[i][k] == 2)
- {
- Console::SetCursorPosition(k, i);
- Console::ForegroundColor = ConsoleColor::Black;
- cout << char(219);
- }
- if (mapa[i][k] == 3)
- {
- Console::SetCursorPosition(k, i);
- Console::ForegroundColor = ConsoleColor::White;
- cout << char(219);
- }
- }
- }
- }
- void Mapa1(int **mapa, int nf, int nc)
- {
- 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 },
- { 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 },
- { 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 },
- { 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,1 },
- { 2,1,2,1,1,1,1,1,2,1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console::SetCursorPosition(x, y);
- cout << " ";
- Console::SetCursorPosition(x+2, y);
- cout << " ";
- Console::SetCursorPosition(x + 1, y + 1);
- cout << " ";
- Console::SetCursorPosition(x, y + 1);
- cout << " ";
- Console::SetCursorPosition(x, y + 2);
- cout << " ";
- Console::SetCursorPosition(x + 1, y + 2);
- cout << " ";
- Console::SetCursorPosition(x + 2, y + 2);
- cout << " ";
- Console::SetCursorPosition(x + 2, y + 1);
- cout << " ";
- Console::SetCursorPosition(x + 1, y);
- cout << " ";
- }
- void pintar_limites()
- {
- for (int i = 0;i < 71;i++)
- {
- Console::SetCursorPosition(i, 0);Console::ForegroundColor = ConsoleColor::Black; cout << char(219);
- Console::SetCursorPosition(i, 20);Console::ForegroundColor = ConsoleColor::Black;cout << char(219);
- }
- for (int i = 0; i < 21;i++)
- {
- Console::SetCursorPosition(70, i);Console::ForegroundColor = ConsoleColor::Black;cout << char(219);
- }
- }
- void dibujarpersonaje(int x, int y)
- {
- Console::SetCursorPosition(x, y);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::Black;
- cout << char(219);
- Console::SetCursorPosition(x +2, y);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::Black;
- cout << char(219);
- Console::SetCursorPosition(x + 1, y+1);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::Black;
- cout << char(219);
- Console::SetCursorPosition(x , y + 1);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::DarkGreen;
- cout << char(219);
- Console::SetCursorPosition(x, y + 2);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::DarkGreen;
- cout << char(219);
- Console::SetCursorPosition(x+1, y + 2);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::Black;
- cout << char(219);
- Console::SetCursorPosition(x + 2, y + 2);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::DarkGreen;
- cout << char(219);
- Console::SetCursorPosition(x + 2, y + 1);
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::DarkGreen;
- cout << char(219);
- Console::SetCursorPosition(x + 1, y );
- Console::BackgroundColor = ConsoleColor::DarkRed;
- Console::ForegroundColor = ConsoleColor::DarkGreen;
- cout << char(219);
- }
- void moverpersonaje(int &x, int &y, int dx, int dy, int **matriz)
- {
- dx = dy = 0;
- if (_kbhit())
- {
- char teclapresionada = _getch();
- teclapresionada = toupper(teclapresionada);
- switch (teclapresionada)
- {
- case 72: dy = -1; dx = 0; break;
- case 80: dy = 1; dx = 0; break;
- case 75: dx = -1; dy = 0; break;
- case 77: dx = 1; dy = 0;
- }
- }
- //1
- if (x + dx < 0 || x + dx>69 || (matriz[y][x + dx] == 2) )
- {
- dx = 0;
- }
- if (y + dy < 0 || y + dy>19|| (matriz[y + dy][x] == 2))
- {
- dy = 0;
- }
- //2
- if (x+2 + dx < 0 || x+2 + dx>69 || (matriz[y][x+2 + dx] == 2))
- {
- dx = 0;
- }
- if (y + dy < 0 || y + dy>19|| (matriz[y + dy][x+2] == 2))
- {
- dy = 0;
- }
- //3
- if (x + 1 + dx < 0 || x + 1 + dx>69 || (matriz[y+1][x + 1 + dx] == 2))
- {
- dx = 0;
- }
- if (y+1 + dy < 0 || y+1 + dy>19 || (matriz[y+1 + dy][x + 1] == 2))
- {
- dy = 0;
- }
- //4
- if (x + dx < 0 || x + dx>69 || (matriz[y + 1][x + dx] == 2))
- {
- dx = 0;
- }
- if (y + 1 + dy < 0 || y + 1 + dy>19 || (matriz[y + 1 + dy][x ] == 2))
- {
- dy = 0;
- }
- //5
- if (x + dx < 0 || x + dx>69 || (matriz[y + 2][x + dx] == 2))
- {
- dx = 0;
- }
- if (y + 2 + dy < 0 || y + 2 + dy>19 || (matriz[y + 2 + dy][x] == 2))
- {
- dy = 0;
- }
- //6
- if (x+1 + dx < 0 || x+1 + dx>69 || (matriz[y + 2][x+1 + dx] == 2))
- {
- dx = 0;
- }
- if (y + 2 + dy < 0 || y + 2 + dy>19 || (matriz[y + 2 + dy][x+1] == 2))
- {
- dy = 0;
- }
- //7
- if (x + 2 + dx < 0 || x + 2 + dx>69|| (matriz[y + 2][x + 2 + dx] == 2))
- {
- dx = 0;
- }
- if (y + 2 + dy < 0 || y + 2 + dy>19|| (matriz[y + 2 + dy][x + 2] == 2))
- {
- dy = 0;
- }
- //8
- if (x + 2 + dx < 0 || x + 2 + dx>69|| (matriz[y + 1][x + 2 + dx] == 2))
- {
- dx = 0;
- }
- if (y + 1+ dy < 0 || y + 1 + dy>19|| (matriz[y + 1 + dy][x + 2] == 2))
- {
- dy = 0;
- }
- //9
- if (x + 1 + dx < 0 || x + 1 + dx>69 || (matriz[y ][x + 1 + dx] == 2))
- {
- dx = 0;
- }
- if (y + dy < 0 || y + dy>19|| (matriz[y + dy][x + 1] == 2))
- {
- dy = 0;
- }
- x = x + dx;
- y = y + dy;
- dibujarpersonaje(x, y);
- Sleep(30);//retardo
- borrarpersonaje(x, y);
- }
- void controlador(int &xpersonaje, int &ypersonaje, int dx, int dy, int ** matriz)
- {
- while (1)
- moverpersonaje(xpersonaje, ypersonaje, dx, dy, matriz);
- }
- void main()
- {
- Console::SetWindowSize(80, 26);
- Console::CursorVisible = false;
- int **mapa;
- int **matriz, xpersonaje, ypersonaje, dx, dy;
- int nf, nc;
- matriz = new int*[25];
- for (int i = 0; i<25; i++)
- matriz[i] = new int[80];
- xpersonaje = 66;
- ypersonaje = 9;
- dx = dy = 0;
- nf = 20;
- nc = 70;
- mapa = new int*[nf];
- for (int i = 0; i<nf; i++)
- mapa[i] = new int[nc];
- Mapa1(mapa, nf, nc);
- pintar_limites();
- controlador(xpersonaje, ypersonaje, dx, dy, mapa);
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement