AI and positioning? [Archive] - C Board

PDA

View Full Version : AI and positioning?


SyntaxBubble
02-16-2002, 06:07 PM
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!

-KEN-
02-17-2002, 06:39 PM
Read the FAQ? :)

POINT pt;
srand(time(NULL));
for(int x=0; x< NumShips; x++)
{
pt.x = rand()%100;
pt.y = rand()%100;
Draw_Ship_At(pt);
}

SyntaxBubble
02-18-2002, 01:00 PM
Thanks for the reply!