Exemplo n.º 1
0
void World::initLevel()
{
	TankVehicle *tank1 = new TankVehicle(TankVehicle::SPACE_SHOOT, this);
	tank1->setPos(667, 207);
	
	TankVehicle *tank2 = new TankVehicle(TankVehicle::SPACE_SHOOT, this);
	tank2->setPos(854, 422);

	Building *helipad = new Building(Building::HELI_PAD, this);
	helipad->setPos(254, 222);

	addObject(helipad);
	addTank(tank1);
	addTank(tank2);
}
Exemplo n.º 2
0
int addTankWithRandom(TANK_MANAGER *t_m)
{
    TANK* temp = create_TankWithRandom();
    TANK* others = t_m->nextTank;
    if( NULL != temp)
    {
        if(NULL != others)
        {
            while(checkTankHitTank(temp, others)) // fang zhi peng zhuang
            {
                srand(rand());
                temp->x = rand();
                temp->y = rand();
            }
            others = others->nextTank;
        }
        addTank(t_m,temp);
        return 0; //success
    }
    return 1; // fail

}