ASCII animation
Last edited on
The lazy way would be a sprite sheet and using SDL
No, I meant doing it in C++.
use a switch statement like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#include <iostream>
using namespace std;
int main()
{
for(int i = 0; i<12; i++){
switch(i){
case 0: cout << "blinking" << flush; sleep(1); break;
case 1: cout << string(8,'\b') << "Man " << endl; break;
case 2: cout << "(-:" << flush; sleep(1); break;
case 3: case 5: case 7: case 9: cout << "\b8" << flush; sleep(1); break;
case 4: case 6: case 8: case 10: cout << "\b:" << flush; sleep(1); break;
case 11: cout << "\b8" << endl; break;
}
}
cout << "Good bye!" << endl;
return(0);
}
|
Thx!
megasnorlax wrote: |
---|
No, I meant doing it in C++. |
SDL is a C++ library...
Topic archived. No new replies allowed.