begin process at 2010 02 10 14:40:54
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

DirectX

 > UN JEU DE VOITURE VOLANTE ET DÉSAMORCAGE DE BOMBE NON TERMINÉ

UN JEU DE VOITURE VOLANTE ET DÉSAMORCAGE DE BOMBE NON TERMINÉ


 Information sur la source

Note :
Aucune note
Catégorie :DirectX Niveau :Initié Date de création :21/08/2003 Date de mise à jour :23/08/2003 12:38:42 Vu :14 485

Auteur : supergrey

Ecrire un message privé
Site perso
Commentaire sur cette source (3)
Ajouter un commentaire et/ou une note

 Description

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

  • 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;
  • }
 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    


 Sources du même auteur

Source avec Zip Source avec une capture JEUX DIRECTX9 COMPLET (JEU D'AVIONS MINIATURES)

 Sources de la même categorie

Source avec Zip Source avec une capture MP3 DX9 JOUER par f_l_a_s_h_b_a_c_k
Source avec Zip Source avec une capture EQUINOX VISUAL SON METER par f_l_a_s_h_b_a_c_k
Source avec Zip Source avec une capture FLEUR EN DELIRE! par f_l_a_s_h_b_a_c_k
Source avec Zip Source avec une capture DIREXCT X 9 D3D par f_l_a_s_h_b_a_c_k
Source avec Zip BLOP DIRECT X par f_l_a_s_h_b_a_c_k

Commentaires et avis

Commentaire de pastoche le 22/08/2003 17:22:02

Salut, je suis parfaitement néophite et jaimerais au moins savoir comment executer ton jeu, jai installer dev-C++4, je crois quil ne suffit pas d'entrer ton texte et d'appuyer sur compile...tu pourrais m'aider?

pastoche

Commentaire de Suisse00 le 05/11/2003 02:48:09

pastoche, j'suis pas sure mais il a dit que cétait seulement un bout de code ! Donc il est pas complet :'(

supergrey faudrais vérifier ton site, il marche pas :'(

Commentaire de supergrey le 05/11/2003 08:51:10

Oui excusez moi mais le site n'est pas accessible pour encore un jour ou deux a cause d'un probleme d'hebergement.
Voila a plus...

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,515 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales