Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < a; i++){
- if (total <= 99){
- total++;
- n = rect.getPosition().x;
- y = rect.getPosition().y;
- // cout << rect.getPosition().x << endl;
- if (((total / 10) % 2 == 0 || total <= 10) && (total % 10 != 1)){
- {
- while (rect.getPosition().x <= n + 64){
- rect.move(5.f, 0.f);
- window.clear();
- window.draw(sp1);
- window.draw(rect);
- window.display();
- }
- }
- }
- else if (((total / 10) % 2 == 1 && total % 10 != 1) || (total % 10) % 2 == 0){
- while (rect.getPosition().x >= n - 64){
- rect.move(-5.f, 0.f);
- window.clear();
- window.draw(sp1);
- window.draw(rect);
- window.display();
- }
- }
- if (total % 10 == 1){
- while (rect.getPosition().y >= y - 64){
- rect.move(0.f, -5.f);
- window.clear();
- window.draw(sp1);
- window.draw(rect);
- window.display();
- }
- }
- if (total == 20 || total == 40 || total == 60 || total == 80 || total == 100)
- {
- while (rect.getPosition().x >= n - (64)){
- rect.move(-5.f, 0.f);
- window.clear();
- window.draw(sp1);
- window.draw(rect);
- window.display();
- }
- }
- if (total == 30 || total == 50 || total == 70 || total == 90)
- {
- while (rect.getPosition().x <= n + (64)){
- rect.move(5.f, 0.f);
- window.clear();
- window.draw(sp1);
- window.draw(rect);
- window.display();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement