/*- -------------------------------------------------------------- -*/ void ResearchRobot::operate(Map& m){ flagDeployedThisRound = false; checkRobotDeath(); // checking to see if the robot must be removed from the map if (m.dangers[get_pos_x()][get_pos_y()] >= 0.6) { // this area is considered dangerous m.flags[get_pos_x()][get_pos_y()] = true; // setting down a flag so that other robots can avoid this area flagsDeployed++; // increase the flags counter for this robot flagDeployedThisRound = true; // deployed a flag } }
void map::Tower3::fire(){ time=clock.getElapsedTime(); timeInt=time.asMilliseconds()+20; if(timeInt%600<20){ int destination=int(rand())%4+1; Projectile1 *wsk=new Projectile1(get_pos_x()+10, get_pos_y()+5, "Grafika/fball.png", speed, 10, 10, destination); projectiles.push_back(wsk); clock.restart(); } }