Results 1 to 5 of 5

Thread: Flickering!!!!!!!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Okay I've gotten a character to bounce around a console window...but now how do I make it stop flickering??? This for example:
    PHP Code:
    #include <iostream.h>
    #include <windows.h>
    #include <conio.h>
    int dummy;

    void pause(unsigned long amount);
    int main()
    {    
        
    float Yspeed 1;
        
    float Xspeed 1;
        
    float x 10;
        
    float y 10;
        
            
    cout<<"o Mover: By Steve Mack"<<endl<<"Use the keypad to move (5 to exit)"<<endl;
            
    pause(2000);
        while(
    x!=1000)
        {
            
    int i;
            for(
    i=1;i<=y+10;i++)
            {
                
    cout<<endl;
            }
            for(
    i=1;i<=x;i++)
            {
                
    cout<<" ";
            }
            
    cout<<"o"<<endl;
            for(
    i=1;i<=25-y;i++)
            {
                
    cout<<endl;
            }
            
    x=x+Xspeed;
            
    y=y+Yspeed;
            if(
    x>=79 || x<=1)
            {
                
    Xspeed=Xspeed*-1;
            }
            if(
    y>=25 || y<=2)
            {
                
    Yspeed=Yspeed*-1;
            }
            
    pause(400);
            
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        }
        
    cin>>dummy;
        return 
    0;
    }

    void pause(unsigned long amount)
    {  
    //creates a delay with the duration of amount.
      
    unsigned long t GetTickCount();
      while((
    GetTickCount() - t) < amount);

    feel free to play with the pauses(by denniswrenn), I want it to go pretty fast but without the flickering.

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I think the flickering is just a product of the fact that using console text is a crappy way to do graphics It's nothing wrong with your code, it's just that the console can't keep up with you.

    have you tried it in full-screen mode? It doesn't look as bad like that, although there is still some flickering when the O is high in the screen.
    Harry.

    "From one thing, know ten thousand things."

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    How do I do that? You mean like setting it to 0X13?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Not necessarily -- you could just use Alt-Enter while it's executing.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    speaking of that...is there any good graphics tutorials?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width