Thread: TANKWARS! some questions

  1. #1
    Registered User
    Join Date
    Dec 2001

    TANKWARS! some questions

    first off, hello this is my first post...
    ive taken introductary c++ courses at my college, im not a CS major, i am a physics major.. but i figured with basic knowledge of c++ i should be able to make the simple tankwars game that was popular about 10 years ago... but i really can't figure out how many parts of this game were developed.

    so #1) does anybody have workin code of the game so i can analyze it and hopefully learn a $hitload in the process?

    #2) if not #1, then how is the ground for each map randomly created?

    hopefully i could see a working version of the game, or at least some insiteful clues as to how it should work. i have all the formulas and such for the trajectories of the projectile, but that is the easy part (for me at least) gettin it to work sux

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    I remember back in like 7th grade, Tank War was just the greatest game ever . I always wondered how they made it back then.

    I am not sure how they actually generated the land, but you can do it yourself fairly easily. I'd say make your own (simple) terrain generation algorithm. Think of the height as a function of the horizontal. You basically want to have it the land slope. So, say, start at the x=0, leftmost part of screen with an initial displacement 0 (corresponding to say, the middle of the screen). The next part will either be the same height, a little higher, or a little lower. Keep track of the current angle. Randomly create a small change in angle for that given horizontal displacement, and change the height as neccessary. Iterate through the whole map, and bam, you have your own randomly generated terrain.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    Registered User
    Join Date
    Dec 2001


    sounds easy enough.. but im still lost. i really am lookin for the code of the game so i can look it over.. i think ill learn alot faster that way.

  4. #4

    Lightbulb Possibly what you are looking for?

    Upon reading this post, I realized that I might have something related to what you want. I have an old "300 games" demo CD that I god about 3 or 4 years ago, and one of the games is an old 2D tank game. In the folder on the CD I found multiple .DLL files. I looked through them, and I honestly don't know if it is what you are looking for.

    If you are interested in getting these just to check it out, please contact me with
    AIM: CarlosTheJackass
    ICQ: 74616133

    I can't include them with this message because you can only include 100KB, and the total of the .DLL files is about 300KB, but I could quickly send them over AIM or ICQ

    Ok, well I really hope this helps you out


  5. #5
    Registered User
    Join Date
    Dec 2001

    Look at Sorched Earth (sp?)

    Look for a game called "Sorched Earth", i think my spelling mght be wrong. Its was called "the mother of all games"
    Just play it a bunch, and think of how they did stuff as your playing.
    I have a few ideas for when i started to make a game like this, i never finished due to lazyness and not knowing windows graphics programming. I might try and make a tank wars clone now with direct x, we will see.
    As for making the land, here are a few ideas.
    Have an array int Ground[width of screen];
    Start with a random hight
    Loop throuh this array and for each pixel add or subtract 0,1 or 2 from the previous pixel.
    If you want to throw in cliffs have a small chance of a bigger increase of 20 to 50. Its really up to you decide.
    Then to figure out where the gound is at a given x coordnate, just use this array as a look up table
    heighofground = Ground[Xcoord];

  6. #6
    Registered User
    Join Date
    Dec 2001


    thanks that helps

  7. #7
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    If you're ever looking for source on a certain type of program/game, check out They have numerous examples for each program type, in many languages.

    If you're wondering, I AM getting paid to tell you this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM