Update of /cvsroot/epfl/tggame
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2342
Modified Files:
game.cc rocket.cc rocket.h
Log Message:
particules roquettes :)
Index: rocket.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/rocket.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rocket.cc 19 Nov 2004 12:05:14 -0000 1.3
--- rocket.cc 19 Nov 2004 18:54:45 -0000 1.4
***************
*** 14,17 ****
--- 14,26 ----
pPhysic->SetVelocity(vVeloc);
pPhysic->SetPhysicCallBack(this);
+
+
+ pEmit = new ParticleEmitter (100, Vector3(0,0,0), Game::pSelf->GetEngine()->pTextureManager->LoadTexture("data/particle.jpg", TG_TEXTURE_2D), 20.0f);
+ pEmit->SetParticlesSpeed (-vVeloc/100);
+ pEmit->SetLife(30.0f);
+ pEmit->Initialize ();
+ Game::pSelf->GetSceneManager()->AddParticlesEmitter(pEmit);
+ pModel->Attach("HEAD", pEmit);
+
//pPhysic->SetSpeed
}
***************
*** 19,23 ****
Rocket::~Rocket ()
{
!
}
--- 28,32 ----
Rocket::~Rocket ()
{
! delete pEmit;
}
***************
*** 25,28 ****
--- 34,39 ----
{
Game::pSelf->RemovePawn(this);
+ Game::pSelf->GetSceneManager()->RemoveParticlesEmitter(pEmit);
+
if (other == NULL) //on a touche la map
{
Index: game.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/game.cc,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** game.cc 19 Nov 2004 12:05:14 -0000 1.35
--- game.cc 19 Nov 2004 18:54:45 -0000 1.36
***************
*** 120,129 ****
pEngine->pMeshManager->Load("rocket", "data/models/rocket/rocket.md5mesh");
-
- ParticleEmitter* pEmit = new ParticleEmitter (100, Vector3(0,0,0), pEngine->pTextureManager->LoadTexture("data/particle.jpg", TG_TEXTURE_2D), 10.0f);
- pEmit->SetParticlesSpeed (Vector3(90,0,0));
- pEmit->SetLife(30.0f);
- pEmit->Initialize ();
- pSceneManager->AddParticlesEmitter(pEmit);
//creation du joueur
--- 120,123 ----
Index: rocket.h
===================================================================
RCS file: /cvsroot/epfl/tggame/rocket.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rocket.h 19 Nov 2004 12:05:14 -0000 1.3
--- rocket.h 19 Nov 2004 18:54:45 -0000 1.4
***************
*** 3,6 ****
--- 3,7 ----
#include "projectile.h"
+ #include <particleemitter.h>
class Rocket : public Projectile
***************
*** 12,15 ****
--- 13,17 ----
protected:
static const float fSpeed;
+ ParticleEmitter* pEmit;
};
|