AI and positioning?

This is a discussion on AI and positioning? within the Game Programming forums, part of the General Programming Boards category; I am currently working on a space combat game. It will be just another one of those games where you ...

  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: trifaze_mattu@lycos.com

    ---------------------------------
    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,230
    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: trifaze_mattu@lycos.com

    ---------------------------------
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21