Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : main project file.
- #include "stdafx.h"
- #include <conio.h>
- #include <iostream>
- using namespace std;
- using namespace System;
- int main()
- {
- int ex, ey, dex, dey;
- dex = 1; dey = 1;//despalamiento enemigo
- ex = 3; ey = 10;
- //mostrar al enemigo
- Console::SetCursorPosition(ex, ey);
- cout << "eeee";
- while (1)
- {
- _sleep(50);
- //esconder al enemigo
- Console::SetCursorPosition(ex, ey);
- cout << " ";
- if (ex == 53)//limite derecho
- dex = -1;
- if (ex == 3)//limite izquierdo
- dex = 1;
- if (ey == 20)//limite inferior
- dey = -1;
- if (ey == 1)//limite superior
- dey = +1;
- //mover al enemigo
- ex += dex;
- ey += dey;
- //mostrar al enemigo de nuevo
- Console::SetCursorPosition(ex, ey);
- cout << "eeee";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment