06-01-2009, 10:13 AM | #1 |
How would I make something like this in C
I would like to make something like this in C, for a "game" that I am trying to make...
I already looked at the Duke3D source code.
__________________
*I taught myself C, C++, C#, VB, HTML, and Javascript. At the moment, I am teaching myself Java, Perl, Objective C, and x86 assembly.* I'm nuts! |
|
06-01-2009, 01:16 PM | #2 |
Re: How would I make something like this in C
What kind of OS? If its DOS and Turbo/Borland C then its something like
Code:
#include <conio.h> int main(int argn, char** argv) { textcolor(7); textbackground(0); clrscr(); textcolor(15); textbackground(4); clreol(); cprintf(" I Rule 3D - the game\n"); clreol(); cprintf(" Copyright (C) 2009 Me Myself and I\n"); textcolor(7); textbackground(0); cprintf("\n\nOther stuff...\n\n\n"); return 0; } For Linux you'll have to dig some ANSI codes for that. |
|
06-01-2009, 05:13 PM | #3 | |
Re: How would I make something like this in C
Quote:
I have taken the courtesy to take a snapshot of the IDE log of Open WATCOM. Please note that I am creating a DOS/4GW application
__________________
*I taught myself C, C++, C#, VB, HTML, and Javascript. At the moment, I am teaching myself Java, Perl, Objective C, and x86 assembly.* I'm nuts!
Last edited by AllAmericanJBert; 06-01-2009 at 05:29 PM.
Reason: Editing my mistake, duh!
|
||
06-01-2009, 08:58 PM | #4 |
Re: How would I make something like this in C
ok, first off you need to read the documentation on your compiler to see what libraries are available and what functions they support. you would then call the functions similarly to the example given. If you are not able to manage that, then you really need to do much more work in acquiring basic programming skills.
__________________
big badass nasty weapons here.... |
|
06-03-2009, 12:44 AM | #5 |
Re: How would I make something like this in C
You might want to look into something called Ansi. I believe it supports a set of escape codes to control color and possibly the text mode cursor location. If not, then you'll need to import some other text mode library.
To keep the text at the top of the screen, you will likely have to scroll the output yourself. By default, when your startup output reaches the bottom of the screen, your top lines start to disappear. Then again, now that I think about it, I think I remember something about being able to control which portion of the screen scrolls. If this functionality is there, you can set it to only scroll from line 2 (assuming the first line is zero) to the bottom of the screen (typically line 24). |
|
Bookmarks |
|
|