Results 1 to 13 of 13
  1. #1
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love

    Clearing/rewriting screen with no delay?

    Currently in my console based RPG, the logic is as follows:

    if left/right/up/down are pressed, move P in that direction.
    Wait 100 MS, then continue.

    if left/right/up/down are NOT pressed, goto the loop before checking to see if they ARE pressed.


    There's no flicker when I'm not moving. But every move has flicker...

    Is there a way to remove the flicker? I currently use system("cls") to clear the screen, then my DisplayMap(); to Write to the screen.


    If there's anyway at all to even JUST clear the player's character and then re-write the player's character that would be AMAZING.
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,669
    My Mood
    Breezy
    Nope, there's no way to clear the screen without system("cls"). I've read about this before, can't remember why.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. #3
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    I HAVE read a way to clear the screen using a homemade function, so I was kind of hoping. Ah well. Super flickering game foreva then.

  4. #4
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    SetConsoleCursorPosition Function (Windows)
    Any type of clearing will cause flickering. Instead, change the console's cursor location and overwrite existing data.

    For related functions see Console Functions (Windows).

  5. The Following User Says Thank You to Fovea For This Useful Post:

    Hell_Demon (06-02-2011)

  6. #5
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    I'm not too great with this. I'll try it out when I get home.

    I need to create a console buffer, or can I just use

    CONSOLE_SCREEN_BUFFER_INFO csbiInfo;

    csbiInfo.dwCursorPosition.X = PlayerX;
    csbiInfo.dwCursorPosition.Y = PlayerY;

    Also, can I use cout still to write to the screen, or do I have to use

    LPSTR lpszPrompt1/2/3/4/5 etc.

    I'm not great with high level input/output functions..
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  7. #6
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    I dont know if i got what you want, but maybe....

    void Navigate(){
    if(Key1){
    system("cls");
    cout << "shit" << endl;
    }

    //hotkeys shit
    }

    //main(), while(1) loop
    if(key1 || key2 || key){

    Navigate();

    }

    That way, only if the key is pressed it will clear..So it will not blink, is that what you want?

    I used something like that a while ago and worked
    Last edited by Lyoto Machida; 06-02-2011 at 04:13 PM.

  8. #7
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by Lyoto Machida View Post
    I dont know if i got what you want, but maybe....

    void Navigate(){
    if(Key1){
    system("cls");
    cout << "shit" << endl;
    }

    //hotkeys shit
    }

    //main(), while(1) loop
    if(key1 || key2 || key){

    Navigate();

    }

    That way, only if the key is pressed it will clear..So it will not blink, is that what you want?

    I used something like that a while ago and worked
    No. I'm already using that lol.

    I have most of everything working...

    ALMOST a working AI. I have studied A*, just haven't implemented it yet.

    A working battle system. Well, it opens up, let's you move the selection key but you can't actually select anything.

    Collision detection.
    But really, in a console application, how hard is this to make...

    But whenever your character moves, the application blinks.
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  9. #8
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Because everytime you Move() it cls() and rewrite the screen

  10. #9
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by Lyoto Machida View Post
    Because everytime you Move() it cls() and rewrite the screen
    mhm. But this is an RPG. With a player, and monsters, and stuff that move. So it's LOTS of moving.. Lot's of blinking. Lot's of RefreshScreen()... D:
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  11. #10
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Quote Originally Posted by VvITylerIvV View Post
    mhm. But this is an RPG. With a player, and monsters, and stuff that move. So it's LOTS of moving.. Lot's of blinking. Lot's of RefreshScreen()... D:
    You should take a look at allegro if you're going to make a game like that.

  12. #11
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by Void View Post
    You should take a look at allegro if you're going to make a game like that.
    lawl. No. If I were to tackle a Graphics API, I'd choose directx.

    I simply want to make a game like this in a console... Just because I can.


    Chances are, it will have 6-7 maps, all accesable through a portal

    on top of that, 1 town.

    4 different monsters

    on top of THOSE, maybe 3-4 different bosses.

    2-3 NPCS

    Somewhere around 6-7 quests.



    I just want to make it because I can, and who else in this world has created a 2d RPG on a console? (not text based, push 1 to go here kinda thing, but using GetAsyncKeyState())
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  13. #12
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    I WANNA PLAY IT

  14. #13
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by Lyoto Machida View Post
    I WANNA PLAY IT
    ONCE I GET THIS FUCKING UNRESOLVED EXTERNAL FIXED I'LL REPLOAD IT!
    BUT I HAVE AN UNRESOLVED EXTERNAL THAT I CAN'T FUCKING FIX *****

    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL