• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Tszafran

VSC++ Console Game

9 posts in this topic

Hi, Im in a computer science class and for a final project our teacher wants us to create a DOS game, we are using Visual C++ 6.0 and I was wondering what could I use to make a semi-decent game. I could use textcolor(2); cprintf("Hello"); to make different text colors, but what could I do to create some DOS graphics? Im still pretty new. Also I have tried installing Allegro with no success (no clue why either, followed instructions also).
0

Share this post


Link to post
Share on other sites
quote:
Original post by Tszafran
I could use ... to make different text colors.

In MSVC? Not you can''t, those are Borland specific functions.
quote:
Original post by Tszafran
Also I have tried installing Allegro with no success (no clue why either, followed instructions also).

Obviously it works for other people, maybe you should try again or ask about any steps that you aren''t sure about. You can try SDL also, if you''re already planning on learning an new library. There''s just about no way to screw up SDL''s installation .

[Resist Windows XP''s Invasive Production Activation Technology!]
0

Share this post


Link to post
Share on other sites
You could make a guess the number game in less than 15 lines of code, and that would qualify as a game. Does your teacher have any type of expectation?
0

Share this post


Link to post
Share on other sites
A console window is completely different than DOS.
You cannot directly access video or text memory in a Win32 console.

If it is DOS, then use a compile that creates DOS applications not console ones.

THE TEXT AREA IS AT B800H
and VIDEO IS AT A000H

good luck.

you could use a window & use textout functions and set the text and background colors.. you could come up with something interesting.


0

Share this post


Link to post
Share on other sites
Sorry, I have VSC++ at home and Borland, but use Borland at school. I followed that SDL installation guide a couple weeks ago on GameDev and it installed correctly. Does anyone have any good sites for basic tutorials (not just documentation)? Or anymore information/sites about DOS related graphics or something? I got a somewhat short time frame so I'm not looking towards anything too complex at the moment.

Also I am new to C++ like 3 months, but learned alot in that time and am passed the basic Guessing Game, and made a Snake Game using Borlands gotoxy() function.
PS.
Thanks for all the replies, they are greatly appreciated.

Edited by - tszafran on December 17, 2001 10:29:15 PM
0

Share this post


Link to post
Share on other sites
quote:
Original post by Tszafran
I followed that SDL installation guide a couple weeks ago on GameDev and it installed correctly. Does anyone have any good sites for basic tutorials (not just documentation)?

You can try Cone3D, he''s started writing some basic SDL tutorials. I personally found the SDL Doc. Project to be more than enough to get me started with SDL. Of course, I don''t use the sound or video portions of SDL (OpenGL and OpenAL do fine for those ), so I''m not sure of the coverage they give to those sections.

[Resist Windows XP''s Invasive Production Activation Technology!]
0

Share this post


Link to post
Share on other sites
I tried the basic SDL application at http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut1

but when I compile this...
#include
#include

#include
...
(Excluded to save room).
...
DrawScene(screen)
}

return 0;
}

I get the missing '';'' at DrawScene(screen)
So I add the comma then I try to compile and get all these errors

MSVC++
--------------------Configuration: SDLMain - Win32 Debug--------------------
Linking...
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_LockSurface
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_UnlockSurface
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_MapRGB
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_Flip
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_PollEvent
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_SetVideoMode
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_Quit
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_GetError
SDLMain.obj : error LNK2001: unresolved external symbol _SDL_Init
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/SDLMain.exe : fatal error LNK1120: 10 unresolved externals
Error executing link.exe.

SDLMain.exe - 11 error(s), 0 warning(s)



PS. I have bad luck with libraries, and I followed the SDL installation at GameDev and tested it with that small test program it had and it worked.
0

Share this post


Link to post
Share on other sites
Are you linking the libraries? Did you set up your project correctly? Do you know what you have to do (if you want me to tell you, tell me what compiler you''re using at the moment. MSVC?). Also: There should be a semicolon (not a comma) there, it isn''t lying to you. There should be semicolons almost everywhere in C/C++ .

[Resist Windows XP''s Invasive Production Activation Technology!]
0

Share this post


Link to post
Share on other sites
Sorry guys, my fault like Null and Void pointed out I was not setting my project properly (linking Libs, etc..) They now compile properly. Thanks alot for your help. Now I am off to code :-)
0

Share this post


Link to post
Share on other sites
You can make text in differnet colors in VC and also use the x-y thing:

///////////////////////////////////////////////////////////////////
//
// this is the header for VC_conio
// these are functions to imitate conio.h
// under Visual C++
//
/////////////////////////////////////////////////////////////////
#ifndef VC_CONIO
#define VC_CONIO


#include
#include
#include
#include

#define getch _getch
#define clreol clrol

enum COLORS {
BLACK, /* dark colors */
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
DARKGRAY, /* light colors */
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
};

void textcolor(COLORS a);
void textbackground(COLORS a);
void textcolor(int a);
void textbackground(int a);
void clrscr();
void gotoxy(short x, short y);
void clrol();
void window(int x, int y, int x1, int y1);

static HANDLE winHan;
static WORD ForeGroundColor = 0;
static WORD BackGroundColor = 0;


#endif


//////////////////////////////////////////////////////////////////
//
// this is the implementation file for VC_conio
// these are functions to imitate conio.h
// under Visual c++
//
/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
#include "VC_conio.h"
//Variablen für den Window Befehl
int global_x; //links
int global_y; //oben
int global_x1; // rechts
int global_y1; // unten
WORD global_color; // Farbe

void textcolor(int a)
{textcolor(COLORS(a));}

void textbackground(int a)
{textbackground(COLORS(a));}

void textcolor(COLORS a)
{
winHan = GetStdHandle(STD_OUTPUT_HANDLE);

WORD _;
switch(a)
{
case BLACK :
_ = 0;
break;
case BLUE : // dark blue text
_ = FOREGROUND_BLUE;
break;
case GREEN : // dark green text
_ = FOREGROUND_GREEN;
break;
case CYAN : // dark cyan text
_ = FOREGROUND_GREEN | FOREGROUND_BLUE;
break;
case RED : // dark red text
_ = FOREGROUND_RED;
break;
case MAGENTA : // dark magenta text
_ = FOREGROUND_RED | FOREGROUND_BLUE;
break;
case BROWN : //dark brown text
_ = FOREGROUND_RED | FOREGROUND_GREEN;
break;
case LIGHTGRAY : //light grey text
_ = FOREGROUND_RED | FOREGROUND_BLUE |FOREGROUND_GREEN;
break;
case DARKGRAY :
_ = FOREGROUND_INTENSITY;
break;
case LIGHTBLUE : // light blue text
_ = FOREGROUND_BLUE |FOREGROUND_INTENSITY;
break;
case LIGHTGREEN : // light green text
_ = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case LIGHTCYAN : // light cyan text
_ = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
break;
case LIGHTRED : // light red text
_ = FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
case LIGHTMAGENTA : // light magenta text
_ = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
break;
case YELLOW : // yellow text
_ = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case WHITE : //white text
_ = FOREGROUND_BLUE | FOREGROUND_RED| FOREGROUND_GREEN
| FOREGROUND_INTENSITY;
break;
default : //white text
_ = FOREGROUND_BLUE | FOREGROUND_RED| FOREGROUND_GREEN
| FOREGROUND_INTENSITY;
break;
}
ForeGroundColor = _;
_ += BackGroundColor;
global_color = _; //Modulglobale Variable setzen
SetConsoleTextAttribute(winHan, _);
}
//=======================================================================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//=======================================================================
void textbackground(COLORS a)
{
winHan = GetStdHandle(STD_OUTPUT_HANDLE);
WORD _;
switch(a)
{
case BLACK ://balck background
_ = 0;
break;
case BLUE ://blue background
_ = BACKGROUND_BLUE;
break;
case GREEN : // dark green background
_ = BACKGROUND_GREEN;
break;
case CYAN : // dark cyan background
_ = BACKGROUND_GREEN | BACKGROUND_BLUE;
break;
case RED : // dark red background
_ = BACKGROUND_RED;
break;
case MAGENTA : // dark magenta background
_ = BACKGROUND_RED | BACKGROUND_BLUE;
break;
case BROWN : //dark brown background
_ = BACKGROUND_GREEN | BACKGROUND_RED;
break;
case LIGHTGRAY: // light grey background
_ = BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN;
break;
case DARKGRAY :
_ = BACKGROUND_INTENSITY;
break;
case LIGHTBLUE : // light blue background
_ = BACKGROUND_BLUE | BACKGROUND_INTENSITY;
break;
case LIGHTGREEN : // light green background
_ = BACKGROUND_GREEN | BACKGROUND_INTENSITY;
break;
case LIGHTCYAN : // light cyan background
_ = BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY;
break;
case LIGHTRED : // light red background
_ = BACKGROUND_RED | BACKGROUND_INTENSITY;
break;
case LIGHTMAGENTA : // light magenta background
_ = BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY;
break;
case YELLOW : // yellow background
_ = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_INTENSITY;
break;
case WHITE : //white background
_ = BACKGROUND_BLUE | BACKGROUND_RED| BACKGROUND_GREEN
| BACKGROUND_INTENSITY;
break;
default :
_ = 0;
}
BackGroundColor = _;
_ += ForeGroundColor;
global_color = _;//Modulglobale Variable setzen
SetConsoleTextAttribute(winHan, _);
}
//=======================================================================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//=======================================================================
inline void gotoxy (short x, short y)
{
winHan = GetStdHandle(STD_OUTPUT_HANDLE);

COORD _ = { x+global_x-1, y+global_y-1 };//Modulglobale Variable verwenden
//In Borland ist (1,1) links oben,
//In VC++ ist (0,0) links oben
//darum -1 !!!!!!

SetConsoleCursorPosition (winHan, _);

}

//=================================================================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//=================================================================
void clrscr ()
{
winHan = GetStdHandle(STD_OUTPUT_HANDLE);
//Dumme Microsoft Befehle beginnen bei 0,0
//---> (x-1)
//weil Borland mit 1,1 beginnt !!!
DWORD len = (global_x1-(global_x))*(global_y1-(global_y)); //laenge*breite
COORD _ = { global_x,global_y };
FillConsoleOutputCharacter(winHan, '' '', len, _, &len);



FillConsoleOutputAttribute(winHan, global_color,len,_,&len);
gotoxy (1, 1);
}
//=====================================================================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//=====================================================================
void clrol()
{
winHan = GetStdHandle(STD_OUTPUT_HANDLE);

CONSOLE_SCREEN_BUFFER_INFO
sInfo;

GetConsoleScreenBufferInfo(winHan, &sInfo);

DWORD len = sInfo.dwSize.X - sInfo.dwCursorPosition.X + 1;

FillConsoleOutputCharacter(winHan, '' '', len,
sInfo.dwCursorPosition, &len);
}


//=====================================================================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//=====================================================================
void window(int x, int y, int x1, int y1)
{
//globale Variablen setzen !!
global_x = x-1; // Window (1,1,....) definiert ab linker oberer Ecke
global_y = y-1;
global_x1 = x1;
global_y1 = y1;
gotoxy (1,1);
}
0

Share this post


Link to post
Share on other sites