Thread: Loading Animation

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    6

    Thumbs up Loading Animation

    I'm trying to creat on of the animations with the slashes as you may know.
    it looks something like this \ | / --. It almost looks something like a star * . If anyone can help me that would be great thanx.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Code:
    
    int Counter=0;
    while(!kbhit())
    {
      gotoxy(1,1);
      switch(Counter)
      {
        case 0:
          printf("|");
          Counter++;
        break;
        case 1:
          printf("/");
          Counter++;
        break;
        case 2:
          printf("-");
          Counter++;
        break;
        case 3:
          printf("\\");
          Counter++;
        break;
        default:
          Counter=0;
      }
    }
    
    You may want to slow it down a bit though . Notice the printf("\\"); where you have to use two \, not one. One \ is used to give special commands to strings like new line ( \n ), tab ( \t ) and so on.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    6
    Thanks!

    That worked perfectly

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cargo loading system
    By kyle rull in forum C Programming
    Replies: 1
    Last Post: 04-20-2009, 12:16 PM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Loading animation
    By rkooij in forum C Programming
    Replies: 6
    Last Post: 04-03-2006, 05:56 AM
  4. Animation class not working
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 03-02-2005, 06:48 AM
  5. Loading Screen
    By pinkcheese in forum Windows Programming
    Replies: 2
    Last Post: 04-06-2002, 11:48 PM