//TINY_ROID
Tiny_Roid::Tiny_Roid()
{
	obj = findFreeObject(100);
	dbCloneObject(obj, TINY_OBJ);
	moveSpeed = TINY_STROID_SPEED;
	totalSpeed = moveSpeed + GAME_SPEED;
	maxMoveSpeed = TINY_STROID_MAX_SPEED;
	size = 1;
	health = 5;
	dmg = .5;
	SC_SetupObject(obj, 1, 2);
	//dbSetObjectAmbient ( ASTERIOD5, 0 );
	SC_UpdateObject(obj); //updates the map's collision box
	dbRotateObject (obj, dbRnd(360) - 360, dbRnd(360) - 360, dbRnd(360) - 360 );
	dbPositionObject(obj, -30, 4,0);
	dbSetObjectCollisionToPolygons(obj );
}
//LARGE_ROID
Large_Roid::Large_Roid()
{
	obj = findFreeObject(100);
	dbCloneObject(obj, LARGE_OBJ);
	moveSpeed = LARGE_STROID_SPEED;
	totalSpeed = moveSpeed + GAME_SPEED;
	maxMoveSpeed = LARGE_STROID_MAX_SPEED;
	size = 5;
	health = 20;
	dmg = 2.0;
	SC_SetupObject(obj, 1, 2);
	//dbSetObjectAmbient ( ASTERIOD1, 0 );
	SC_UpdateObject(obj); //updates the map's collision box
	dbRotateObject (obj, dbRnd(360) - 360, dbRnd(360) - 360, dbRnd(360) - 360 );
	dbPositionObject(obj, 0, -30,0);
	dbSetObjectCollisionToPolygons(obj );
}
//MEDIUM_ROID
Medium_Roid::Medium_Roid()
{
	obj = findFreeObject(100);
	dbCloneObject(obj, MEDIUM_OBJ);
	moveSpeed = MEDIUM_STROID_SPEED;
	totalSpeed = moveSpeed + GAME_SPEED;
	maxMoveSpeed = MEDIUM_STROID_MAX_SPEED;
	size = 3;
	health = 10;
	dmg = 1.0;
	SC_SetupObject(obj, 1, 2);
	//dbSetObjectAmbient ( ASTERIOD3, 0 );
	SC_UpdateObject(obj); //updates the map's collision box
	dbRotateObject (obj, dbRnd(360) - 360, dbRnd(360) - 360, dbRnd(360) - 360 );
	dbPositionObject(obj, -30, 4,0);
	dbSetObjectCollisionToPolygons(obj );
}
Beispiel #4
0
Rocket::Rocket(int i, char *filename)
{
	num = i;
	alive = false;//ракета деактивирована
	burn = false;
	Xpos = 0;
	Ypos = 0;
	Zpos = 0;
	Ydeg = 0;
	start_time = GetTickCount();
	if (num == myrocket)//перва¤ ракета
	{
dbLoadObject(filename,num);//загружаем еЄ из файла,
	}
	else //так как все ракеты одинаковы, то...
	{
		dbCloneObject(num, myrocket);
		//...остальные копируем с первой
	}
		dbHideObject(num);//скрываем
	dbPositionObject(num, Xpos, Ypos, Zpos);
	dbYRotateObject(num, Ydeg);
}