Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1929 in orxonox.OLD for orxonox/trunk/core/player.cc


Ignore:
Timestamp:
Jun 8, 2004, 11:02:09 PM (21 years ago)
Author:
bensch
Message:

orxonox/trunk: inhibitor added, so it shoots in impulses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/core/player.cc

    r1927 r1929  
    7575void Player::shoot(int n)
    7676{
    77   shootLaser->addShoot(xCor, yCor, zCor);
    78   shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
    79   shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
    80   shootRocket->addBackParable(xCor, yCor, zCor);
    81   shootRocket->addSideAcc(xCor, yCor, zCor, RIGHT);
    82   shootRocket->addSideAcc(xCor, yCor, zCor, LEFT);
    83   shootRocket->addRotater(xCor, yCor, zCor);
     77  if (shootLaser->inhibitor++ >=100)
     78    {
     79      if (shootLaser->inhibitor++ <= 150)
     80        shootLaser->addShoot(xCor, yCor, zCor);
     81      else if (shootLaser->inhibitor++ >= 250 && shootLaser->inhibitor <= 300)
     82        shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
     83      else if (shootLaser->inhibitor++ >= 350)
     84        shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
     85      if (shootLaser->inhibitor >=400)
     86        shootLaser->inhibitor =0;
     87    }
     88  if (shootRocket->inhibitor++ >=80)
     89    {
     90      shootRocket->addBackParable(xCor, yCor, zCor);
     91      shootRocket->addSideAcc(xCor, yCor, zCor, RIGHT);
     92      shootRocket->addSideAcc(xCor, yCor, zCor, LEFT);
     93      shootRocket->addRotater(xCor, yCor, zCor);
     94      if (shootRocket->inhibitor >=90)
     95        shootRocket->inhibitor =0;
     96    }
    8497  //cout << "Player::shoot" << endl;
    8598}
Note: See TracChangeset for help on using the changeset viewer.