Un jeu de voiture volante et désamorcage de bombe non terminé

Contenu du snippet

Voici la source d'un jeu que je n'ai jamais fini, alors si ca vous tente...
Vous controlez une voiture volante et vous devez poser 3emetteur pour pouvoir trianguler la position de la bombe et pouvoir la cibler avec la camera de votre vehicule volant, ensuite si il vous reste assez de temp il vous faut désamorcer la bombe avant qu'elle n'explose!
Pour plus d'info contactez moi à supergrey@tiscali.fr !
Pour tous mes jeux : www.greygames.fr.st !

Source / Exemple :


La source en question faisant plus de 50ko je vous laisse le lien ver celle-ci:
http://supergrey.chez.tiscali.fr/SourceCpp/DFCH.exe
C'est une archive auto-extractible  

voici un bout de la source:

HRESULT CMyD3DApplication::FrameMove()
{
	NFRAME++;
    // Update user input state
    UpdateInput( &m_UserInput );

    // Respond to input
    if( m_UserInput.bDoConfigureInput )
    {
        // One-shot per keypress
        m_UserInput.bDoConfigureInput = FALSE;

        Pause( TRUE );

        // Get access to the list of semantically-mapped input devices
        // to delete all InputDeviceState structs before calling ConfigureDevices()
        CInputDeviceManager::DeviceInfo* pDeviceInfos;
        DWORD dwNumDevices;
        m_pInputDeviceManager->GetDevices( &pDeviceInfos, &dwNumDevices );

        for( DWORD i=0; i<dwNumDevices; i++ )
        {
            InputDeviceState* pInputDeviceState = (InputDeviceState*) pDeviceInfos[i].pParam;
            SAFE_DELETE( pInputDeviceState );
            pDeviceInfos[i].pParam = NULL;
        }

        // Configure the devices (with edit capability)
        if( m_bWindowed )
            m_pInputDeviceManager->ConfigureDevices( m_hWnd, NULL, NULL, DICD_EDIT, NULL );
        else
            m_pInputDeviceManager->ConfigureDevices( m_hWnd,
                                                     m_pDIConfigSurface,
                                                     (VOID*)StaticConfigureInputDevicesCB,
                                                     DICD_EDIT, (LPVOID) this );

        Pause( FALSE );
    }

    if( m_UserInput.bDoConfigureDisplay )
    {
        // One-shot per keypress
        m_UserInput.bDoConfigureDisplay = FALSE;

        Pause(TRUE);

        // Configure the display device
        UserSelectNewDevice();

        Pause(FALSE);
		Vue	= 0;

    }

    // TODO: update world

	if (bMarche)
	{
		if (dVoBo<4.5f)
		{
			if (dVoBo>0 && Voiture->bVie)
			{
			Perso->px+=(Perso->px-Voiture->position.x)*(4.5f-dVoBo)/10;
			Perso->py+=(Perso->py-Voiture->position.y)*(4.5f-dVoBo)/10;
			Perso->pz+=(Perso->pz-Voiture->position.z)*(4.5f-dVoBo)/10;
			Voiture->position.x-=(Perso->px-Voiture->position.x)*(4.5f-dVoBo)/20;
			Voiture->position.y-=(Perso->py-Voiture->position.y)*(4.5f-dVoBo)/20;
			Voiture->position.z-=(Perso->pz-Voiture->position.z)*(4.5f-dVoBo)/20;
			}
		}
		Perso->Mouvement();
		Perso->PreRender(Sol);
		dVoBo=dist3d(D3DXVECTOR3(Perso->px,Perso->py,Perso->pz),Voiture->position);
		if (AXPZ>199)
		AXPZ=Voiture->FrameMove(Sol);
		else
		Voiture->FrameMove(Sol);

	}
	else
	{
		if (AXPZ>199)
		AXPZ=Voiture->FrameMove(Sol);
		else
		{
			if (Voiture->FrameMove(Sol)==0)
			AXPZ=0;
		}
	}
	VoitureC->FrameMove(Sol);

	if (Bomb.ncle<10)
	Seconde-=0.05f;
	if (Seconde<0)
	{
		Seconde+=60;
		Minute-=1;
	}
	if (Minute==-1 && Seconde>59.95f)
		AXPZ=0;

	float d=dist3d(vLookatPt,vFromPt);
	float dc=Contact(Sol,(vFromPt-vLookatPt)/d,vLookatPt);
	if ( dc<d-0.2f && dcam>0.02f )	dcam*=0.8f;
	else if (dc>d+0.2f)				dcam*=1.2f;

	if (dcam>1)dcam=1;

    D3DXMATRIX matView;
	if (bMarche)
	{
		if (Perso->vy<-0.2f)
		{

		vLookatPt = MatTrans(D3DXVECTOR3(0,2.5f,0),Perso->mtete2);
		vFromPt  = vLookatPt;
		vFromPt.y  += 3;
		vUpVec    = D3DXVECTOR3(-sinf(Perso->aRY),0,-cosf(Perso->aRY));
		Perso->ALookUp=0;
		}
		else
		{
		vLookatPt = MatTrans(D3DXVECTOR3(0.25f,2.3f,-1),Perso->mtete2);
		vFromPt   = MatTrans(D3DXVECTOR3(0.25f,2.3f,0),Perso->mtete2);
		vUpVec    = MatTrans(D3DXVECTOR3(0,1,0),Perso->mtete2)-MatTrans(D3DXVECTOR3(0,0,0),Perso->mtete2);
		}
	}
	else
	{
		if (Vue==0)
		{
		vLookatPt = Voiture->position;
		vFromPt  += (vLookatPt-(Voiture->inertie-D3DXVECTOR3(5*sinf(-Voiture->ADir),2,-5*cosf(-Voiture->ADir)))*2*dcam-vFromPt)/10;
		vUpVec    = D3DXVECTOR3( 0.0f, 1.0f, 0.0f );
		}
		else
		{
		vFromPt   = MatTrans(D3DXVECTOR3(0,dcam*2,0),Voiture->matChassi);
		vLookatPt = MatTrans(D3DXVECTOR3(0,dcam*1.9f,1),Voiture->matChassi);
		vUpVec    = MatTrans(D3DXVECTOR3(0,1,0),Voiture->matChassi)-MatTrans(D3DXVECTOR3(0,0,0),Voiture->matChassi);
		}  
	}
	m_Camera.SetViewParams( vFromPt, vLookatPt, vUpVec );
	m_pd3dDevice->SetTransform( D3DTS_VIEW, &m_Camera.GetViewMatrix() );

    return S_OK;
}

Conclusion :


Si vous désirez mon jeu trialtime contacter moi ou rendez vous sur www.greygames.fr.st

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.