Forum Archive

Go Back   3D Realms Forums > General Topics > Programming Forum
Blogs FAQ Community Calendar

Notices

 
 
Thread Tools
Old 06-01-2009, 10:13 AM   #1
AllAmericanJBert

AllAmericanJBert's Avatar
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.
Attached Images
File Type: png redbar.png (8.5 KB, 39 views)
__________________
*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!
AllAmericanJBert is offline  
Old 06-01-2009, 01:16 PM   #2
Bad Sector

Bad Sector's Avatar
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;
}
(it might or might not work - i just wrote it from memory, it has been years since i touched turbo c)

For Linux you'll have to dig some ANSI codes for that.
Bad Sector is offline  
Old 06-01-2009, 05:13 PM   #3
AllAmericanJBert

AllAmericanJBert's Avatar
Exclamation Re: How would I make something like this in C
Quote:
Originally Posted by Bad Sector View Post
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;
}
(it might or might not work - i just wrote it from memory, it has been years since i touched turbo c)

For Linux you'll have to dig some ANSI codes for that.
Actually, it did not work: textcolor(); textbackground(); clreol(); and clrscr(); were not defined

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
Attached Images
File Type: jpg josh_log.jpg (28.7 KB, 17 views)
__________________
*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!
AllAmericanJBert is offline  
Old 06-01-2009, 08:58 PM   #4
Jiminator

Jiminator's Avatar
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....
Jiminator is offline  
Old 06-03-2009, 12:44 AM   #5
Fragger00
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).
Fragger00 is offline  
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:44 AM.

Page generated in 0.12544703 seconds (100.00% PHP - 0% MySQL) with 19 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.