Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1929 in orxonox.OLD for orxonox/trunk


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

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

Location:
orxonox/trunk/core
Files:
4 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}
  • orxonox/trunk/core/shoot_laser.cc

    r1920 r1929  
    3030  lastShoot = null;
    3131  step = 1.0;
     32  inhibitor = 0;
    3233}
    3334
  • orxonox/trunk/core/shoot_laser.h

    r1920 r1929  
    3030  ~ShootLaser ();
    3131
     32  int inhibitor;
     33
    3234  void drawShoot(void);
    3335  void addShoot(shoot* sh);
  • orxonox/trunk/core/shoot_rocket.cc

    r1927 r1929  
    153153  sh->next = lastShoot;
    154154  lastShoot = sh;
    155   inhibitor =0;
    156 }
     155  }
    157156void ShootRocket::addSideAcc(float x, float y, float z, enum RocketDirection direction)
    158157{
     
    173172  sh->next = lastShoot;
    174173  lastShoot = sh;
    175   inhibitor =0;
    176 
    177 }
     174}
     175
    178176void ShootRocket::addRotater(float x, float y, float z)
    179177{
     
    191189  sh->next = lastShoot;
    192190  lastShoot = sh;
    193   inhibitor =0;
    194191}
    195192
Note: See TracChangeset for help on using the changeset viewer.