Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include "mapas.hpp"
- #define FILAS 24
- #define COLUMNAS 80
- #define IZQUIERDA 75
- #define DERECHA 77
- #define ARRIBA 72
- #define ABAJO 80
- using namespace std;
- using namespace System;
- void pintarT(int x, int y) {
- Console::SetCursorPosition(x, y); Console::ForegroundColor = ConsoleColor::DarkRed; cout << (char)219 << (char)219 << (char)219 << (char)219 << (char)219 << (char)219 << (char)219;
- }
- void borrar(int x, int y) {
- Console::SetCursorPosition(x, y);
- Console::BackgroundColor = ConsoleColor::Cyan; cout << " ";
- }
- void dibujo(int nivel[FILAS][COLUMNAS]) {
- for (int cf = 0; cf < FILAS; cf++)
- {
- for (int cc = 0; cc < COLUMNAS; cc++)
- {
- Console::SetCursorPosition(cc, cf);
- switch (nivel[cf][cc])
- {
- case 0:Console::ForegroundColor = ConsoleColor::White; cout << (char)219; break;
- case 1:Console::ForegroundColor = ConsoleColor::Magenta; cout << (char)219; break;
- case 2:Console::ForegroundColor = ConsoleColor::DarkYellow; cout << (char)219; break;
- case 3:Console::ForegroundColor = ConsoleColor::Cyan; cout << (char)219; break;
- case 4:Console::ForegroundColor = ConsoleColor::DarkRed; cout << (char)219; break;
- case 5:Console::ForegroundColor = ConsoleColor::DarkGray; cout << (char)219; break;
- case 6:Console::ForegroundColor = ConsoleColor::Gray; cout << (char)219; break;
- case 7:Console::ForegroundColor = ConsoleColor::DarkMagenta; cout << (char)219; break;
- case 8:Console::ForegroundColor = ConsoleColor::Green; cout << (char)219; break;
- case 9:Console::ForegroundColor = ConsoleColor::Blue; cout << (char)219; break;
- case 10:Console::ForegroundColor = ConsoleColor::Red; cout << (char)219; break;
- case 11:Console::ForegroundColor = ConsoleColor::DarkGreen; cout << (char)219; break;
- case 20:Console::ForegroundColor = ConsoleColor::DarkCyan; cout << (char)219; break;
- case 21:Console::ForegroundColor = ConsoleColor::DarkCyan; cout << (char)219; break;
- }
- }
- }
- }
- void pintaPer() {
- Console::ForegroundColor = ConsoleColor::White; cout << (char)219; cout << (char)219;
- }
- int main() {
- repite:
- int i = 0;
- int x = 2;
- int y = 4;
- int w = 2;
- int z = 2;
- dibujo(lvl1);
- while (i<68)
- {
- _sleep(100);
- borrar(x, y);
- pintarT(x + 1, y);
- if (i<64)
- {
- borrar(w, y);
- pintarT(w + 1, y);
- w++;
- }
- if (i<57)
- {
- borrar(z, y);
- pintarT(z + 1, y);
- z++;
- }
- x++;
- ++i;
- }
- goto repite;
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement