Game programming

Moderators: None (Apply to moderate this forum)
Number of threads: 2070
Number of posts: 5361

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
Want to start programming in games.. baffles me Posted by JD on 10 Feb 2000 at 8:31 PM
No, I am not a complete idiot <br>
I am fairly fluent in computers, and understand BASIC, HTML, JAVA, C/C++, etc. I originally started off with a goal to program computer games. I've got a little side tracked.. Well, anyway, I would like to know which language is best to use for games (C++, anyone?), and also how the heck I'm supposed to use it. I've read my C++ book 3 times now... and I still don't understand how do get graphics on the screen and other key elements. The only thing I can display is text. Also, somebody PLEASE explain to me the use of pointers...My friends and I are confused! I mean, why don't you just use the variable name? Thanks for your answers!<br>
-JD<br>



Edit Report
Re: Want to start programming in games.. baffles me Posted by Jack Sotac on 11 Feb 2000 at 11:38 AM
and I still don't understand how do get graphics on the screen and other key elements. The only thing I can display is text. Also, somebody PLEASE explain to me the use of pointers...My friends and I are confused! I mean, why don't you just use the variable name? Thanks for your answers!<br>
<br>
Book that teach Basic C++(like the ones at school)almoust never mention graphic programming. Game/graphic programming is a specialized field when requires books all by its self. To start, you need to get out of text screen mode to a VGA graphic mode(DOS). Graphic modes enable bitmap pictures and sprites to be placed on the screen. <br>
All variables have an address in memory, and a value that is placed at that address. This value can be a float,interger,char, or an address to another variable. If variable B contains the address of variable A, then variable B can can the value of variable B. Say we were to get the address of screen graphic memory. We then place that address as the value of our own poiinter variable. Now we are able to manipulate screen graphic memory with the pointer variable we created.<br>
//Assume real mode <br>
char *screen;<-pointer variable <br>
screen = 0xa0000000 ;<-set it to address of graphic memory<br>
//switch to screen graphic mode using BIOS //functions<br>
asm mov ax,0x13<-graphic mode 13 (320X200X8)<br>
asm int 0x10 <-call BIOS<br>
*(screen + y *320 +x) = 5;//change graphic memory<br>
<br>



Edit Report
Re: Re: Want to start programming in games.. baffles me Posted by BenGmo on 13 Feb 2000 at 5:28 PM
You may already know this, but maybe not, nobody ever told me... ;) Pointers are arrays. Arrays are pointers. Example:<br>
char myname[20];<br>
is the same as:<br>
char *myname = malloc(20);<br>
An array is simply a pointer with memory allocated for it. Thus:<br>
unsigned char *vgamemory = 0xA0000000;<br>
// set mode 13h<br>
videomemory[x + y * 320] = color;<br>
Voila! Sorry if you are thinking "Of course I knew that! Do I look like a moron?"


Edit Report
Re: Want to start programming in games.. baffles me Posted by Unknown on 25 Feb 2000 at 11:16 PM
: No, I am not a complete idiot <br>
: I am fairly fluent in computers, and understand BASIC, HTML, JAVA, C/C++, etc. I originally started off with a goal to program computer games. I've got a little side tracked.. Well, anyway, I would like to know which language is best to use for games (C++, anyone?), and also how the heck I'm supposed to use it. I've read my C++ book 3 times now... and I still don't understand how do get graphics on the screen and other key elements. The only thing I can display is text. Also, somebody PLEASE explain to me the use of pointers...My friends and I are confused! I mean, why don't you just use the variable name? Thanks for your answers!<br>
: -JD<br>
<br>
Standard C/C++ librarys don't provide the definitions for game/graphics related structs, classes, functions, etc. You must define your own. If you started studying C/C++ game programming now, it may take 1 year to learn how to create a game. In DOS, that is. Windows may take another year of studying (You know, a minimal C/C++/Win32 program requires 60 lines?). C/C++ books teach the language's _syntax_. Graphics, and other non-standard functions, are irrelevant to learning C/C++. All C/C++ beginner books start in DOS.<br>
<br>
Personally -- if you don't know Pointers, a subject an entire book could be dedicated to -- I recommend Java. Java predefines everything for you; methods to load/draw images, load/play sounds, networking, etc. Despite the rumor that Java is slow, it is sufficient for any type of game. It's only slow _compared to C/C++_. http://www.javagamepark.com is a perfect example of Java's game capabilities.<br>
In addition, game programming requires an understanding of game concepts -- Sprites, animation, collision detection, etc -- specifically.<br>
<br>
<br>






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.