Clearing/rewriting screen with no delay?

Posts 1–13 of 13 · Page 1 of 1
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.
Nope, there's no way to clear the screen without system("cls"). I've read about this before, can't remember why.
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.
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..
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
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.
Because everytime you Move() it cls() and rewrite the screen
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:
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.
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())
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 *****

Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us