Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 20, 2004, 1:01:57 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: added ability to shoot. so check out the new release and shoot the fuck up

File:
1 edited

Legend:

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

    r1883 r1896  
    2020#include <iostream>
    2121
     22
    2223using namespace std;
    2324
     
    2526Player::Player () {
    2627  xCor = yCor = zCor = 0;
     28  shootLaser = new ShootLaser;
    2729}
    2830
    29 
    30 
    31 Player::~Player () {}
     31Player::~Player ()
     32{
     33  //delete shootLaser;
     34}
    3235
    3336
     
    3740}
    3841
    39 void Player::getPosition(float* x, float* y, float* z)
     42
     43void Player::getPosition(float* x, float* y, float* z)
    4044{
    4145  *x = xCor; *y = yCor; *z = zCor;
     
    4448void Player::goX(float x)
    4549{
     50  //cout << "Player::goX" << endl;
    4651  xCor += x;
    4752}
     
    5863}
    5964
    60 void Player::shoot(int n) {
     65void Player::shoot(int n)
     66{
     67  shootLaser->addShoot(xCor, yCor, zCor);
     68  //cout << "Player::shoot" << endl;
    6169}
    6270
     
    6775void Player::drawPlayer(void)
    6876{
    69   //cout << "Player::drawPlayer()" << endl;
    70   //glColor3f(0.0, 0.9, 0.7);
    71   //glRectf(-0.5 + yCor, -0.5 + xCor, 0.5 + yCor, 2.0 + xCor);
    72 
    7377  glPushMatrix();
     78  glTranslatef(xCor, yCor, 3.0);
    7479  glScalef(1.0, 3.0, 1.0);
    75   glTranslatef(xCor, yCor, 3.0);
    7680  glutWireCube(1.0);
    7781  glPopMatrix();
     82  /* draw all the shoots additionaly */
     83  shootLaser->drawShoot();
     84  //cout << "Player::drawPlayer" << endl;
     85}
    7886
    7987
    80   //cout << "x: " << xCor << " y: " << yCor << endl;
    81 }
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
Note: See TracChangeset for help on using the changeset viewer.