Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/System.hpp>
- #include <iostream>
- int main(int argc, char** argv) {
- sf::Clock clock;
- int x = 0;
- bool isUp = true;
- bool isDown= false;
- while(1) {
- if(clock.getElapsedTime() > sf::Time(sf::seconds(0.1))) {
- if (x == 0){
- std::cout << "0" << std::endl;
- bool isUp = true;
- bool isDown= false;
- x++;
- }
- else if (x == 1){
- std::cout << " 0" << std::endl;
- if(isUp){
- x++;
- }
- else if(isDown){
- x--;
- }
- }
- else if (x == 2){
- std::cout << " 0" << std::endl;
- if(isUp){
- x++;
- }
- else if(isDown){
- x--;
- }
- }
- else if (x == 3){
- std::cout << " 0" << std::endl;
- if(isUp){
- x++;
- }
- else if(isDown){
- x--;
- }
- }
- else if (x == 4){
- std::cout << " 0" << std::endl;
- if(isUp){
- x++;
- }
- else if(isDown){
- x--;
- }
- }
- else if (x == 5){
- std::cout << " 0" << std::endl;
- if(isUp){
- x++;
- }
- else if(isDown){
- x--;
- }
- }
- else if (x == 6){
- std::cout << " 0" << std::endl;
- if(isUp){
- x++;
- }
- else if(isDown){
- x--;
- }
- }
- else if (x == 7){
- std::cout << " 0" << std::endl;
- x--;
- bool isUp = false;
- bool isDown= true;
- }
- clock.restart();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment