Advertisement

making a text game- need help

Started by March 24, 2001 11:14 PM
3 comments, last by Mccy257 23 years, 10 months ago
making this simple: -using c -writing a text adventure game with no graphics -how do I clear the screen in Microsoft Visual C++ 6.0 and move the cursor to the top left portion of the screen? -Do you have any ideas for me or suggestions about the battle system? -where can I learn to add simple graphics to this game? thanks
quote:
Original post by Mccy257

making this simple:

-using c
-writing a text adventure game with no graphics



quote:

-how do I clear the screen in Microsoft Visual C++ 6.0 and move the cursor to the top left portion of the screen?


You need to tell us a little more. You might be using VC++ 6.0 but are you writing this text adventure as a command console application, MFC, Windows SDK, DirectX, OpenGl? Each one has it''s own answer (and certainly I could only answer a couple of these anyway) so do let us know.

quote:

-Do you have any ideas for me or suggestions about the battle system?


Hey...think up of your own ideas. Seriously, most traditional text adventures involved this sort of thing.
>HIT MAN
with what?
>WITH SWORD
I do not understand.
>HIT MAN WITH SWORD
You do not have the sword.

You could take that sort of approach but with a more modern parser to about the ''I do not understand problem''. My guess is that you''d really want to take inspiration from some of the early Final Fantasy type battle sequences, even if it is sort of a text based equivalent, or store some sort of hit points for the man and have each hit of the sword take a certain amount of damage off him. Repeat hits until dead. Sort of a text based melee system. Seriously, you could do no worse than going and buying a D&D gaming set for inspiration.

quote:

-where can I learn to add simple graphics to this game?


I thought you didn''t want to add graphics?



Advertisement
I meant I wanted to add graphics after I make the game...maybe for the sequel
If you want to make a text adventure you should seriously check out - http://www.adrift.org.uk/. It is the best text adventure maker i''ve seen, very easy to use. It takes care of all the grunt work, all you do is make the actual game. It takes care of rooms, characters, battles, objects, events and everything else.

*** Triality ***
*** Triality ***
Ok for the last time to those trying to understand how to clear the screen under vc++ 6.0 console/text app, there are two methods

#1) use System("cls"); might be in windows.h, dont remember tho

#2) Learn to use the windows api. the windows api supplies access functions specifically for manipulating the output of console applications. remember a win32 console app, is still a windows application, so writing certain code that worked in dos will not work in windows.

This clear function should work, just include the proper headers:
bool Clear ()
{
HANDLE hconsole = GetStdHandle (STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
if (!GetConsoleScreenBufferInfo (hconsole, &csbi))
return false;
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
DWORD dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
return (FillConsoleOutputCharacter
(hconsole, '' '',dwConSize, coordScreen, &cCharsWritten) &&
FillConsoleOutputAttribute (hconsole, csbi.wAttributes,
dwConSize, coordScreen, &cCharsWritten) &&
SetConsoleCursorPosition (hconsole, coordScreen));
}

This topic is closed to new replies.

Advertisement