Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Unidades_Graficas.h"
- //sentido de pertenencia = :://
- Unidades_Graficas::Unidades_Graficas()// nace c:
- {
- //x = System::Console::WindowWidth /2;
- //y = System::Console::WindowHeight /2;
- x = rand() % 70 + 1;
- y = rand() % 20 + 1;
- representacion = rand()%121 +30;
- color = rand() % 5 + 1;
- }
- Unidades_Graficas::~Unidades_Graficas()//muere :,v
- {
- }
- void Unidades_Graficas::mostrar()
- {
- switch (color)
- {
- case 1: System::Console::ForegroundColor = System::ConsoleColor::Blue; break;
- case 2:System::Console::ForegroundColor = System::ConsoleColor::Yellow; break;
- case 3:System::Console::ForegroundColor = System::ConsoleColor::DarkYellow; break;
- case 4:System::Console::ForegroundColor = System::ConsoleColor::Green; break;
- case 5:System::Console::ForegroundColor = System::ConsoleColor::DarkGreen; break;
- default:
- break;
- }
- System::Console::SetCursorPosition(x,y);
- std::cout << representacion;
- }
- void Unidades_Graficas::ocultar()
- {
- System::Console::SetCursorPosition(x, y);
- std::cout << ' ';
- }
- void Unidades_Graficas::mover_x()
- {
- x = x + desx;
- }
- void Unidades_Graficas::mover_y()
- {
- y += desy;
- }
Add Comment
Please, Sign In to add comment