|
From: julien r. <jul...@us...> - 2004-10-31 11:40:55
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20572 Modified Files: aicontroller.cc aicontroller.h game.cc playercontroller.cc playercontroller.h Log Message: deplacements Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** game.cc 31 Oct 2004 11:03:06 -0000 1.22 --- game.cc 31 Oct 2004 11:40:44 -0000 1.23 *************** *** 135,139 **** p->SetPosition(Vector3(50,70,0)); ! p->SetRotationVelocity(Quaternion(10,Vector3(0,1,1))); //p->SetRotation(Quaternion(90,Vector3(0,1,0))); //p->SetPosition(pWorld->GetRandomStartPosition()+Vector3(0,30,0)); --- 135,139 ---- p->SetPosition(Vector3(50,70,0)); ! //p->SetRotationVelocity(Quaternion(10,Vector3(0,1,1))); //p->SetRotation(Quaternion(90,Vector3(0,1,0))); //p->SetPosition(pWorld->GetRandomStartPosition()+Vector3(0,30,0)); Index: aicontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** aicontroller.cc 31 Oct 2004 11:03:06 -0000 1.5 --- aicontroller.cc 31 Oct 2004 11:40:44 -0000 1.6 *************** *** 11,14 **** --- 11,19 ---- int rot=0; + int AIController::FORWARD = 3; + int AIController::BACKWARD = 2; + int AIController::STRAFELEFT = 0; + int AIController::STRAFERIGHT = 1; + void AIController::Think (float eTime) { *************** *** 33,39 **** #endif ! pPawn->SetRotation(Quaternion(rot++, Vector3::UNIT_Y)); ! rot=rot%360; ! bDir[0]=1; } --- 38,44 ---- #endif ! //pPawn->SetRotation(Quaternion(rot++, Vector3::UNIT_Y)); ! //rot=rot%360; ! bDir[STRAFELEFT]=1; } Index: aicontroller.h =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** aicontroller.h 28 Oct 2004 21:20:33 -0000 1.3 --- aicontroller.h 31 Oct 2004 11:40:44 -0000 1.4 *************** *** 7,10 **** --- 7,14 ---- class AIController : public Controller { + static int FORWARD; + static int BACKWARD; + static int STRAFELEFT; + static int STRAFERIGHT; public: AIController (Pawn* p) : Controller(p) {} Index: playercontroller.h =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** playercontroller.h 25 Oct 2004 20:04:14 -0000 1.4 --- playercontroller.h 31 Oct 2004 11:40:44 -0000 1.5 *************** *** 13,17 **** CLIP=1 }; ! public: PlayerController (Pawn*); --- 13,21 ---- CLIP=1 }; ! ! static int FORWARD; ! static int BACKWARD; ! static int STRAFELEFT; ! static int STRAFERIGHT; public: PlayerController (Pawn*); Index: playercontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** playercontroller.cc 30 Oct 2004 17:46:47 -0000 1.10 --- playercontroller.cc 31 Oct 2004 11:40:44 -0000 1.11 *************** *** 5,8 **** --- 5,13 ---- using namespace tg; + int PlayerController::FORWARD = 0; + int PlayerController::BACKWARD = 1; + int PlayerController::STRAFELEFT = 2; + int PlayerController::STRAFERIGHT = 3; + PlayerController::PlayerController(Pawn* p) : Controller (p) { *************** *** 55,74 **** case TGKEY_w: //iForward += 1; ! bDir[0] = true; SoundManager::pSoundManager->PlaySound("step"); break; case TGKEY_s: //iForward -= 1; ! bDir[1] = true; SoundManager::pSoundManager->PlaySound("step"); break; case TGKEY_a: //iStrafe -= 1; ! bDir[2] = true; SoundManager::pSoundManager->PlaySound("step"); break; case TGKEY_d: //iStrafe += 1; ! bDir[3] = true; SoundManager::pSoundManager->PlaySound("step"); break; --- 60,79 ---- case TGKEY_w: //iForward += 1; ! bDir[FORWARD] = true; SoundManager::pSoundManager->PlaySound("step"); break; case TGKEY_s: //iForward -= 1; ! bDir[BACKWARD] = true; SoundManager::pSoundManager->PlaySound("step"); break; case TGKEY_a: //iStrafe -= 1; ! bDir[STRAFELEFT] = true; SoundManager::pSoundManager->PlaySound("step"); break; case TGKEY_d: //iStrafe += 1; ! bDir[STRAFERIGHT] = true; SoundManager::pSoundManager->PlaySound("step"); break; *************** *** 88,107 **** { case TGKEY_w: ! bDir[0] = false; SoundManager::pSoundManager->StopSound("step"); break; case TGKEY_s: //iForward = 0; ! bDir[1] = false; SoundManager::pSoundManager->StopSound("step"); break; case TGKEY_a: ! bDir[2] = false; SoundManager::pSoundManager->StopSound("step"); break; case TGKEY_d: //iStrafe = 0; ! bDir[3] = false; SoundManager::pSoundManager->StopSound("step"); break; --- 93,112 ---- { case TGKEY_w: ! bDir[FORWARD] = false; SoundManager::pSoundManager->StopSound("step"); break; case TGKEY_s: //iForward = 0; ! bDir[BACKWARD] = false; SoundManager::pSoundManager->StopSound("step"); break; case TGKEY_a: ! bDir[STRAFELEFT] = false; SoundManager::pSoundManager->StopSound("step"); break; case TGKEY_d: //iStrafe = 0; ! bDir[STRAFERIGHT] = false; SoundManager::pSoundManager->StopSound("step"); break; |