/* This private constructor is only to be used for cloning bots, note that this does not setup the velocity for this bot. */ RandomFloatingBot::RandomFloatingBot( unsigned int initMin, unsigned int initMax, unsigned int initMaxVelocity) { // INIT THE BASIC STUFF initBot(initMin, initMax, initMaxVelocity); }
RandomWanderingBot::RandomWanderingBot(unsigned int initMin, unsigned int initMax){ initBot(initMin, initMax, 0); velocity.x = 0; velocity.y = 0; numCollisionsWithPlayer = 0; isFollowingPlayer = false; }
/* This private constructor is only to be used for cloning bots, note that this does not setup the velocity for this bot. */ RandomJumpingBot::RandomJumpingBot( unsigned int initMin, unsigned int initMax, unsigned int initMaxVelocity) { // INIT THE BASIC STUFF initBot(initMin, initMax, initMaxVelocity); cyclesRemainingBeforeThinking = 30; body->SetTransform(*new b2Vec2(0,0),0); pickRandomCyclesInRange(); }
/* This private constructor is only to be used for cloning bots, note that this does not setup the velocity for this bot. */ RandomJumpingBot::RandomJumpingBot( unsigned int initMin, unsigned int initMax, unsigned int initMaxVelocity) { // INIT THE BASIC STUFF initBot(initMin, initMax, initMaxVelocity); cyclesRemainingBeforeThinking = 30; pp.setVelocity(0.0f, 0.0f); pickRandomCyclesInRange(); }
/* This is the public constructor used by other classes for creating these types of bots. */ RandomFloatingBot::RandomFloatingBot( Physics *physics, unsigned int initMin, unsigned int initMax, unsigned int initMaxVelocity) { // INIT THE BASIC STUFF initBot(initMin, initMax, initMaxVelocity); // AND START THE BOT OFF IN A RANDOM DIRECTION AND VELOCITY // AND WITH RANDOM INTERVAL UNTIL IT THINKS AGAIN pickRandomVelocity(physics); pickRandomCyclesInRange(); }
int main (int argc, char ** argv) { struct irc * bot = malloc (sizeof (struct irc)); if(argc < 6) { printf ("USO: ./%s ip porta nick canal mestre\n", argv[0]); return -1; } initBot(bot, argv[1],atoi(argv[2]), argv[3], argv[4], argv[5]); SAY ("%s %d %s %s\n", bot->server, bot->port, bot->nick, bot->chan); connectBot(bot); free (bot); return 0; }
/* This is the public constructor used by other classes for creating these types of bots. */ RandomJumpingBot::RandomJumpingBot( Physics *physics, unsigned int initMin, unsigned int initMax, unsigned int initMaxVelocity) { // INIT THE BASIC STUFF initBot(initMin, initMax, initMaxVelocity); // AND START THE BOT OFF IN A RANDOM DIRECTION AND VELOCITY // AND WITH RANDOM INTERVAL UNTIL IT THINKS AGAIN body->SetTransform(*new b2Vec2(0,0),0); //pickRandomJump(physics); pickRandomCyclesInRange(); }