Nope, there's no way to clear the screen without system("cls"). I've read about this before, can't remember why.
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:
Definition of computing: The use or operation of computers.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
Turning on my computer = computing = programming
LAWLFAIL
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]
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.
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).
Hell_Demon (06-02-2011)
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:
Definition of computing: The use or operation of computers.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
Turning on my computer = computing = programming
LAWLFAIL
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.
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:
Definition of computing: The use or operation of computers.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
Turning on my computer = computing = programming
LAWLFAIL
Because everytime you Move() it cls() and rewrite the screen
Favourite quotes:
Definition of computing: The use or operation of computers.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
Turning on my computer = computing = programming
LAWLFAIL
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:
Definition of computing: The use or operation of computers.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
Turning on my computer = computing = programming
LAWLFAIL
I WANNA PLAY IT
Favourite quotes:
Definition of computing: The use or operation of computers.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
Turning on my computer = computing = programming
LAWLFAIL