Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7101 in orxonox.OLD for trunk


Ignore:
Timestamp:
Feb 7, 2006, 6:48:10 PM (19 years ago)
Author:
patrick
Message:

spaceship collides with arena

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7089 r7101  
    2222#include "render2D/billboard.h"
    2323#include "state.h"
     24#include "class_list.h"
    2425
    2526#include "player.h"
    2627#include "playable.h"
    27 
     28#include "space_ships/space_ship.h"
     29
     30#include "shared_network_data.h"
     31
     32#include <list>
    2833
    2934using namespace std;
     
    156161void MultiplayerTeamDeathmatch::checkGameRules()
    157162{
    158   //
     163
     164  Vector big_left(-201, 0, 0);
     165  float rBig = 176.0f;
     166  Vector big_right(177, 0, 0);
     167  Vector small_left(10, 0, 0);
     168  Vector small_middle(0, 0, 0);
     169  Vector small_right(-10, 0, 0);
     170  float rSmall = 90.0f;
     171
     172
    159173  // check for max killing count
    160174  if( this->teamAKills >= this->maxKills)
     
    166180    // team B winns
    167181  }
    168 }
    169 
    170 
    171 
    172 
    173 
    174 
     182
     183
     184
     185
     186  std::list<BaseObject*>::const_iterator it;
     187  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
     188
     189  if( SharedNetworkData::getInstance()->isGameServer())
     190  {
     191    for(it = list->begin(); it != list->end(); it++)
     192    {
     193      float dist = (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len();
     194      if( (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len() > rBig &&
     195           (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_right).len() > rBig &&
     196           (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_left).len() > rSmall &&
     197           (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_middle).len() > rSmall &&
     198           (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_right).len() > rSmall)
     199      {
     200        PRINTF(0)("KILLLLLLLL\n");
     201
     202        if((*it)->isA(CL_SPACE_SHIP))
     203          dynamic_cast<SpaceShip*>(*it)->doCollideNetwork(116369220.33434f);
     204      }
     205    }
     206  }
     207
     208
     209}
     210
     211
     212
     213
     214
     215
  • trunk/src/world_entities/space_ships/space_ship.cc

    r7095 r7101  
    772772}
    773773
     774
    774775void SpaceShip::doCollideNetwork( float energy )
    775776{
  • trunk/src/world_entities/space_ships/space_ship.h

    r7092 r7101  
    4747
    4848
     49    //HACK HACK HACK make this private or remove it
     50    void doCollideNetwork( float energy );
     51
    4952  private:
    5053    void init();
     
    5255    void calculateVelocity(float time);
    5356
    54     void doCollideNetwork( float energy );
     57
    5558
    5659    bool                  bUp;                //!< up button pressed.
Note: See TracChangeset for help on using the changeset viewer.