Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7113 in orxonox.OLD for trunk/src/world_entities/test_entity.cc


Ignore:
Timestamp:
Feb 8, 2006, 2:20:19 AM (18 years ago)
Author:
patrick
Message:

trunk: different death animations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/test_entity.cc

    r7078 r7113  
    5959  this->setClassID(CL_TEST_ENTITY, "TestEntity");
    6060  this->toList(OM_GROUP_00);
     61
     62  this->bDeath = false;
    6163}
    6264
     
    104106void TestEntity::dieHard()
    105107{
    106   this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
     108  if( this->bDeath)
     109    return;
     110  this->bDeath = true;
     111  float anim;
     112  int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
     113
     114  PRINTF(0)("randi = %i\n", randi);
     115
     116  if( randi == 1)
     117    this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
     118  else if( randi == 2)
     119    this->setAnim(DEATH_FALLFORWARD, MD2_ANIM_ONCE);
     120  else if( randi == 3)
     121    this->setAnim(DEATH_FALLBACKSLOW, MD2_ANIM_ONCE);
     122  else if( randi == 4)
     123    this->setAnim(CROUCH_DEATH, MD2_ANIM_ONCE);
     124  else
     125    this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
    107126}
    108127
Note: See TracChangeset for help on using the changeset viewer.