Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3596 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Mar 17, 2005, 6:03:46 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: borders for the Player, so he cannot move out of the line

File:
1 edited

Legend:

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

    r3590 r3596  
    1919
    2020#include "player.h"
     21
    2122#include "stdincl.h"
    2223//#include "collision.h"
     
    2425#include "list.h"
    2526#include "weapon.h"
     27#include "track_manager.h"
    2628
    2729using namespace std;
     
    169171  //orthDirection = orthDirection.cross (direction);
    170172
    171   if( this->bUp) { accel = accel+(direction*acceleration); }
    172   if( this->bDown) { accel = accel-(direction*acceleration); }
    173   if( this->bLeft ) { accel = accel - (orthDirection*acceleration); }
    174   if( this->bRight ) { accel = accel + (orthDirection*acceleration); }
    175   if( this->bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
     173  if( this->bUp && this->getRelCoor().x < 20)
     174    accel = accel+(direction*acceleration);
     175  if( this->bDown && this->getRelCoor().x > -5)
     176    accel = accel-(direction*acceleration);
     177  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
     178    accel = accel - (orthDirection*acceleration);
     179  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
     180    accel = accel + (orthDirection*acceleration);
     181  if( this->bAscend )
    176182  if( this->bDescend) {/* FIXME */} /* \todo up and down player movement */
    177183
Note: See TracChangeset for help on using the changeset viewer.