Advertisement
Ivan3L

clase hito 3 desaparece y aparece en mismo lugar

Jun 13th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <conio.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6. using namespace System;
  7.  
  8. int main()
  9. {
  10.     int ex=3, ey=10, dex=1;
  11.     int sx = 10, sy = 5, dsx=1;
  12.  
  13.     Console::SetCursorPosition(ex, ey);
  14.     cout << "xxxx";
  15.  
  16.  
  17.     Console::SetCursorPosition(sx, sy);
  18.     cout << char(1);
  19.  
  20.     while (1)
  21.     {
  22.  
  23.  
  24.         _sleep(100);
  25.    
  26.         Console::SetCursorPosition(sx, sy);
  27.         cout << " ";
  28.    
  29.         if (sx == 33)
  30.             sx=0;
  31.         sx += dsx;
  32.  
  33.         Console::SetCursorPosition(sx, sy);
  34.         cout << char (1);
  35.  
  36.  
  37.  
  38.  
  39.         Console::SetCursorPosition(ex, ey);
  40.         cout << "    ";
  41.    
  42.         if (ex == 53)
  43.             dex = -1;
  44.         if (ex == 3)
  45.             dex = 1;
  46.         ex += dex;
  47.  
  48.         Console::SetCursorPosition(ex, ey);
  49.         cout << "xxxx";
  50.     }
  51.     _getch();
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement