Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.64 KB | None | 0 0
  1. for (int i = 0; i < a; i++){
  2.                         if (total <= 99){
  3.                             total++;
  4.                             n = rect.getPosition().x;
  5.                             y = rect.getPosition().y;
  6.                         //  cout << rect.getPosition().x << endl;
  7.                             if (((total / 10) % 2 == 0 || total <= 10) && (total % 10 != 1)){
  8.                                 {
  9.                                     while (rect.getPosition().x <= n + 64){
  10.                                         rect.move(5.f, 0.f);
  11.                                         window.clear();
  12.                                         window.draw(sp1);
  13.                                         window.draw(rect);
  14.                                         window.display();
  15.                                     }
  16.                                 }
  17.                             }
  18.                             else if (((total / 10) % 2 == 1 && total % 10 != 1) || (total % 10) % 2 == 0){
  19.                                 while (rect.getPosition().x >= n - 64){
  20.                                     rect.move(-5.f, 0.f);
  21.                                     window.clear();
  22.                                     window.draw(sp1);
  23.                                     window.draw(rect);
  24.                                     window.display();
  25.                                 }
  26.                             }
  27.                             if (total % 10 == 1){
  28.                                 while (rect.getPosition().y >= y - 64){
  29.                                     rect.move(0.f, -5.f);
  30.                                     window.clear();                                
  31.                                     window.draw(sp1);
  32.                                     window.draw(rect);
  33.                                     window.display();
  34.                                 }
  35.                             }
  36.                             if (total == 20 || total == 40 || total == 60 || total == 80 || total == 100)
  37.                             {
  38.                                 while (rect.getPosition().x >= n - (64)){
  39.                                     rect.move(-5.f, 0.f);
  40.                                     window.clear();
  41.                                     window.draw(sp1);
  42.                                     window.draw(rect);
  43.                                     window.display();
  44.                                 }
  45.                             }
  46.                             if (total == 30 || total == 50 || total == 70 || total == 90)
  47.                             {
  48.                                 while (rect.getPosition().x <= n + (64)){
  49.                                     rect.move(5.f, 0.f);
  50.                                     window.clear();
  51.                                     window.draw(sp1);
  52.                                     window.draw(rect);
  53.                                     window.display();
  54.                                 }
  55.                             }
  56.                         }
  57.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement