Пример #1
0
static void fb_spawn_door(gedict_t* ent) {
	gedict_t* original = ent;
	vec3_t position;

	VectorScale (original->s.v.mins, 0.5, position);
	VectorMA (position, 0.5, original->s.v.maxs, position);
	position[2] = min (original->s.v.mins[2], original->s.v.maxs[2]) + 24;
	ent = CreateMarker(PASSVEC3(position));
	ent->classname = "door_marker";
	ent->fb.door_entity = original;
	ent->s.v.solid = SOLID_NOT;     // this will be set to SOLID_TRIGGER if MARKER_DOOR_TOUCHABLE flag set

	if (ent->fb.wait < 0) {
		// TODO: ?
		return;
	}
	else if ((int)ent->s.v.spawnflags & SECRET_OPEN_ONCE) {
		// TODO: ?
		return;
	}
	else {
		if (ent->s.v.health) {
			//Add_takedamage(ent);
		}

		adjust_view_ofs_z(ent);
		//BecomeMarker(ent);
	}
}
Пример #2
0
/*
 * Function: main
 * -----------------
 * Serves as entry point of program. Takes in all user inputs to determine specific boggle configuration.
 * Then, it gives the user a chance to find words in the boggleBoard. Then, the computer takes over
 * to find any remaining words. Finally, gives user option to play another round.
 *
 *@return 0 if program completed successfully.
 */
int main()
{
	Randomize(); //initializes random constructor
	SetWindowSize(8, 5);
	InitGraphics();
	Welcome();
	GiveInstructions();
	Lexicon wordList("lexicon.dat"); //generates list of all possible words
	while (true) {
		Lexicon usedWords; //generates a list that stores all words found by the player and computer
		InitGraphics();
		SoundFeature();
		int boardDimension = BoggleBoardSize();
		DrawBoard(boardDimension, boardDimension);
		Grid<char> boggleBoard(boardDimension, boardDimension);
		if (!UserBoardConfiguration()) {
			InitializeRandomBoard(boggleBoard); //if user chooses not to specify board configuration, a random one is generated
		} else {
			string diceConfig = GetDiceConfiguration(boardDimension);
			SetDiceConfiguration(boggleBoard, diceConfig);
		}
		DrawBoggleBoard(boggleBoard);
		Grid<bool> usedDice(boggleBoard.numRows(), boggleBoard.numCols());
		CreateMarker(usedDice);
		InputGuesses(boggleBoard, wordList, usedWords, usedDice); //player's turn
		FindRemainingWords(boggleBoard, wordList, usedWords, usedDice); //computer's turn
		PlayNamedSound("thats pathetic.wav"); //assumes the player will always lose to the computer
		if (!GameContinue()) break;
	}
	return 0;
}
Пример #3
0
osg::Node* CreateMarkerNode( float scale = 1.0f )
{
	// create marker geode
	osg::Geode* pGeode = new osg::Geode;
	pGeode->addDrawable( CreateMarker() );

	// turn off lighting
	osg::StateSet* pStateSet = pGeode->getOrCreateStateSet();
	pStateSet->setMode( GL_LIGHTING, osg::StateAttribute::OFF );

	// scale the marker
	osg::PositionAttitudeTransform* pPat = new osg::PositionAttitudeTransform;
	pPat->setScale( osg::Vec3( scale, scale, scale ) );
	pPat->addChild( pGeode );

	return pPat;
}
void CBodyFX::UpdateMarker()
{
	if (!m_pClientDE || !m_hServerObject) return;

	CClientInfoMgr *pClientMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (!pClientMgr) return;

	CLIENT_INFO* pLocalInfo = pClientMgr->GetLocalClient();
	CLIENT_INFO* pInfo = pClientMgr->GetClientByID(m_bs.nClientId);
	if (!pInfo ||  !pLocalInfo) return;
	LTBOOL bSame = (pInfo->team == pLocalInfo->team);

	if (bSame)
	{
		if (m_hMarker)
			RemoveMarker();
		return;
	}

    uint32 dwFlags = g_pLTClient->GetObjectFlags(m_hServerObject);
	if (!(dwFlags & FLAG_VISIBLE))
	{
		RemoveMarker();
		return;
	}


    LTVector vU, vR, vF, vTemp, vDims, vPos;
    LTRotation rRot;

    ILTPhysics* pPhysics = m_pClientDE->Physics();

	m_pClientDE->GetObjectPos(m_hServerObject, &vPos);
	pPhysics->GetObjectDims(m_hServerObject, &vDims);
	vPos.y += (vDims.y + 20.0f);

	if (!m_hMarker)
	{
		CreateMarker(vPos,bSame);
	}

	if (m_hMarker)
	{
		m_pClientDE->SetObjectPos(m_hMarker, &vPos);
	}
}