Here is a simple two player tank game written with C++Builder. Written by : Chuck Kelly www.monroe.cc.mi.us/ckelly Date : November 29th, 2000 Copyright : This program is public domain. Use at your own risk. I assume no responsibilities for anything that may go wrong. You're on your own. Parts of this program are derived from an Internet source. Refer to comments in "timer.cpp" for further information reqarding copyright information on those files. Description : This game demonstrates several techniques that may be useful to you in your programs. In no certain order they are: Network Communications - This game utilizes Winsock and UDP/IP to allow players to compete via a LAN or the Internet. Resource File - The graphic images and sounds are contained in a resource file. This makes it possible to place the entire game in a single executable file. The resource file that I created is "tanks.rc" . Its nothing more than a simple text file. You can view its contents with notepad or any text editor. The resource file is included in the C++Builder project file and compiled with the rest of the source files. The compiled resource file is "tanks.res". Once the images and sounds are in a resouce you can use routines like "LoadFromResourceName" and "PlaySound" to use them. Each resource needs a name. I chose names like "ID_TANKSR", but you can use whatever you want. Look in the FormActivate routine for an example of loading images from a resource file. High Resolution Windows Timer - I can't take credit for this code. I found it on the Web. It does seem to work quite well. Look in the file "timer.cpp" for comments and the web address. Keyboard Scanning - Games need to respond to simultaneous key presses. In order to accomplish this, I use C++Builder's "FormKeyDown" and "FormKeyUp" functions. An array is used to keep track of which keys are depressed. (Note! Some keyboards have limited support for multiple keypresses. If you experience problems playing this game, try a different keyboard :) Double Buffering - Also called Dirty Rectangle Animation. This technique uses offscreen buffers to minimize accesses to the display screen and reduces image flicker. Display Scaling - If your using DirectX you can change the resolution of the screen. Since I wanted this game to run without requiring DirectX I scale the images based on the current screen resolution. This makes the tanks appear to be the same size no matter what the screen resolution is. In order for the game to play the same on machines with different screen resolutions I use two coordinate systems. That is, there are two sets of X,Y coordinates for each object. The game coordinate system is the same no matter what the screen resolution is set to. The screen coordinates are derived from the game coordinates by applying a scaling factor.