Code: Show/Hide void botInfo::MoveBall(int ident, int x, int y) { tell(makeFollowing(false));//makes the bot stop following people tell(makeFlying(true));//makes the bot stop sending it's own position tell(makeSendPosition(false)); tell(makeShip(SHIP_Warbird));//sc to ship 1 tell(makeGrabBall(ident));//ball's ident me->move(x*16,y*16);//tells the bot the coords you want tell(makeSendPosition(true));//makes the bot actually go there tell(makeShip(SHIP_Spectator));//ball is dropped } |
Code: Show/Hide // #include "time.h" // to get an area for ball to be placed in. this range would be in 450-550 x 500-600 srand(time(NULL)); rand(); int coordx = (int) (100 * ((float)rand()/RAND_MAX)) + 450; int coordy = (int) (100 * ((float)rand()/RAND_MAX)) + 500; |