Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2036 in orxonox.OLD for orxonox/trunk/src/player.cc


Ignore:
Timestamp:
Jun 27, 2004, 7:48:44 PM (21 years ago)
Author:
patrick
Message:

orxonxo/trunk/src: extended framework: class inheritance, right including (had som bugs), framework not finished yet

File:
1 edited

Legend:

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

    r1957 r2036  
    1616*/
    1717
     18#include <iostream>
     19#include <stdlib.h>
     20#include <GL/glut.h>
     21
     22#include "shoot_laser.h"
     23#include "shoot_rocket.h"
     24#include "data_tank.h"
    1825
    1926#include "player.h"
    20 #include <iostream>
    21 #include <stdlib.h>
    22 
    2327
    2428using namespace std;
    2529
    2630
    27 Player::Player () {
    28   // cout << "Player::Player" << endl;
     31Player::Player()
     32   : WorldEntity() {
     33  //cout << "Player::Player" << endl;
    2934  xCor = yCor = zCor = 0;
    3035  shootLaser = new ShootLaser;
     
    5863void Player::goX(float x)
    5964{
    60   //cout << "Player::goX" << endl;
    6165  xCor += x;
    6266}
     
    7377}
    7478
     79
     80
    7581void Player::shoot(int n)
    7682{
     83
    7784  //  if (shootLaser->inhibitor++ <= 100)
    78     shootLaser->addShoot(xCor, yCor, zCor);
    79     // else if (shootLaser->inhibitor++ <= 200)
    80     shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
    81     //  else if (shootLaser->inhibitor++ <= 300)
    82     shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
    83     //  else
    84     shootLaser->inhibitor =0;
     85  shootLaser->addShoot(xCor, yCor, zCor);
     86  // else if (shootLaser->inhibitor++ <= 200)
     87  shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
     88  //  else if (shootLaser->inhibitor++ <= 300)
     89  shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
     90  //  else
     91  shootLaser->inhibitor =0;
    8592 
    86     //  if (shootRocket->inhibitor++ >=80)
    87     {
    88       shootRocket->addBackParable(xCor, yCor, zCor);
    89       shootRocket->addSideAcc(xCor, yCor, zCor, RIGHT);
    90       shootRocket->addSideAcc(xCor, yCor, zCor, LEFT);
    91       shootRocket->addRotater(xCor, yCor, zCor);
    92       //  if (shootRocket->inhibitor >=90)
    93       //        shootRocket->inhibitor =0;
    94     }
     93  //  if (shootRocket->inhibitor++ >=80)
     94  {
     95    shootRocket->addBackParable(xCor, yCor, zCor);
     96    shootRocket->addSideAcc(xCor, yCor, zCor, RIGHT);
     97    shootRocket->addSideAcc(xCor, yCor, zCor, LEFT);
     98    shootRocket->addRotater(xCor, yCor, zCor);
     99    //  if (shootRocket->inhibitor >=90)
     100    //        shootRocket->inhibitor =0;
     101  }
    95102  //cout << "Player::shoot" << endl;
     103 
     104  /*
     105  shootLaser->addShoot(xCor, yCor, zCor);
     106  shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
     107  shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
     108  //shootRocket->addShoot(xCor, yCor, zCor);
     109  //cout << "Player::shoot" << endl;
     110  */
    96111}
    97112
     
    100115
    101116
    102 void Player::drawPlayer(void)
     117void Player::paint()
    103118{
     119  //cout << "Player::drawPlayer" << endl;
    104120  glPushMatrix();
    105121  glTranslatef(xCor, yCor, 3.0);
     
    110126  shootLaser->drawShoot();
    111127  shootRocket->drawShoot();
    112   //cout << "Player::drawPlayer" << endl;
     128  //cout << "Player::drawPlayer, end" << endl;
    113129}
    114130
Note: See TracChangeset for help on using the changeset viewer.