Thread: AI and positioning?

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question AI and positioning?

    I am currently working on a space combat game. It will be just another one of those games where you scroll from side to side shooting the enemies in space. I need to know something. How do I use a for loop to draw a specified amount of enemy planes at a random "x" position? I am using OpenGL!
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Read the FAQ?
    Code:
    POINT pt;
    srand(time(NULL));
    for(int x=0; x< NumShips; x++)
    {
         pt.x = rand()%100;
         pt.y = rand()%100;
         Draw_Ship_At(pt);
    }

  3. #3
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Thanks!

    Thanks for the reply!
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

Popular pages Recent additions subscribe to a feed