Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Console Game Development (http://www.programmingforums.org/showthread.php?t=15367)

KuraKai Mar 7th, 2008 4:00 PM

Console Game Development
 
I am starting to work on a game for the console, there are currently three things that I need to figure out how to get done first before I work on it.
The first one is secured password input, where character inputs are replaced my either other characters or just a blank spot.
The second one is updating just a single portion of the console output, like to change just the bottom right without having to update everything else.
Finally is a clearing the console or clearing a portion of it.
Does anyone have any help for this?

Brent Mar 7th, 2008 6:07 PM

Re: Console Game Development
 
What operating system and compiler are you running?

here are some links I found on google.com

www.gametutorials.com
www.ultimategameprogramming.com
www.gamedev.net
www.cprogramming.com

KuraKai Mar 7th, 2008 6:57 PM

Re: Console Game Development
 
Windows and the Compiler for Visual Studio, the first two links are from 3D Games and the first one is for a book I have to purchase! The third one shows some nifty handiness of encryptions and stuff but was mostly meant for 3D games. And the fourth one shows me some nifty formatting of text, but none of them answered my questions.

Seif Mar 8th, 2008 7:33 AM

Re: Console Game Development
 
check out the <windows.h> header. It pretty much has all you need. Check the MSDN for console reference . http://msdn2.microsoft.com/en-us/lib...87(VS.85).aspx

Ancient Dragon Mar 8th, 2008 8:11 AM

Re: Console Game Development
 
I think pdcurses might be one way to solve your problem, and its free.

Gennadios Mar 8th, 2008 10:02 PM

Re: Console Game Development
 
I programmed a console Tetris clone a while back, this is the function I used to set the cursor position to the location that needs changing, it should be what you're looking for:

:

  1. #include<windows.h>
  2.  
  3. void gotoxy(int x, int y);
  4.  
  5. void gotoxy(int x, int y)
  6. {
  7.         COORD point;
  8.         point.X = x;
  9.         point.Y = y;
  10.         SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), point);
  11. }


It will also allow you to overwrite any input, so you can replace critical inputs with asterisks or whatever you'd like.

You can also use the if(kbhit()) and getch() statements to get sensitive inputs without them being printed onscreen.

Ancient Dragon Mar 8th, 2008 10:53 PM

Re: Console Game Development
 
Quote:

Originally Posted by Gennadios (Post 142239)
You can also use the if(kbhit()) and getch() statements to get sensitive inputs without them being printed onscreen.

You could only if you have a compiler that supports those two functions. They are non-standard and are not available to many (most) compilers. Which is a pitty because I like them too.

Irwin Mar 9th, 2008 7:32 AM

Re: Console Game Development
 
Stupid methodology by the previous posters, it is quite simple to just parse results from ReadConsoleInput and do all the raw handling from there.

KuraKai Mar 9th, 2008 4:34 PM

Re: Console Game Development
 
I now have another question for this, How do I make Win32 Console GUI. If you take a look at the BIOS or even the Windows Installer for XP you will notice they have GUIs that are done in with ASCII. I tried to work this out by doing...
:

  1. cout << (char)169 << (char)196 << (char)196 << (char)196 << (char)170 << "\n";
  2. cout << (char)179;

That looks like a start but it quickly becomes obvious that there are going to be gaps and there not going to be connected properly. Is there any other way of accomplishing this?

Game_Ender Mar 12th, 2008 1:24 AM

Re: Console Game Development
 
Did you look at the pdcurses link posted above? Its basically a console GUI library that works on Windows. It should have most if not all of what you need.


All times are GMT -5. The time now is 3:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC