Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2006, 12:31:27 AM (17 years ago)
Author:
marcscha
Message:

Last update, collision working again. SEGFAULT problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10113 r10117  
    147147  Weapon* wpRight1 = new LightBlaster ();
    148148  wpRight1->setName( "LightBlaster");
    149   wpRight1->setParent( this);
     149  //wpRight1->setParent( this);
    150150  Weapon* wpLeft1 = new LightBlaster ();
    151151  wpLeft1->setName( "LightBlaster");
    152   wpLeft1->setParent( this);
     152  //wpLeft1->setParent( this);
    153153
    154154  Weapon* wpRight2 = new MediumBlaster ();
    155155  wpRight2->setName( "MediumBlaster");
    156   wpRight2->setParent( this);
     156  //wpRight2->setParent( this);
    157157  Weapon* wpLeft2 = new MediumBlaster ();
    158158  wpLeft2->setName( "MediumBlaster");
    159   wpLeft2->setParent( this);
     159  //wpLeft2->setParent( this);
    160160 
    161161  Weapon* wpRight3 = new HeavyBlaster ();
    162162  wpRight3->setName( "HeavyBlaster");
    163   wpRight3->setParent( this);
     163  //wpRight3->setParent( this);
    164164  Weapon* wpLeft3 = new HeavyBlaster ();
    165165  wpLeft3->setName( "HeavyBlaster");
    166   wpLeft3->setParent( this);
     166  //wpLeft3->setParent( this);
    167167
    168168  Weapon* cannon = new SwarmLauncher();
    169169  cannon->setName( "SwarmLauncher");
    170   cannon->setParent( this);
     170  //cannon->setParent( this);
    171171
    172172
     
    180180  this->secWeaponMan.addWeapon( cannon, 0, 0);
    181181
    182 
     182/*
    183183  wpRight1->requestAction(WA_ACTIVATE);
    184184  wpLeft1->requestAction(WA_ACTIVATE);
     
    190190
    191191  cannon->requestAction(WA_ACTIVATE);
    192 
     192*/
    193193 
    194194  this->weaponMan.changeWeaponConfig(1);
     
    418418void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
    419419{
    420   PRINTF(0)("SPACESHIP COLLIDED WITH %s\n",entity->getCName());
    421420}
    422421
     
    669668
    670669void SpaceShip::damage(float pDamage, float eDamage){
    671   PRINTF(0)("ship hit for (%f,%f) \n",pDamage,eDamage);
     670  PRINTF(5)("ship hit for (%f,%f) \n",pDamage,eDamage);
    672671
    673672  if( this->shieldActive) {
     
    968967void SpaceShip::nextWeaponConfig()
    969968{
    970  
    971   this->curWeaponPrimary    = (curWeaponPrimary + 1) % 3;
    972   this->weaponMan.changeWeaponConfig(this->curWeaponPrimary);
     969  PRINTF(0)("Requested next weapon config!\n");
     970  this->weaponMan.nextWeaponConfig();
    973971  Playable::weaponConfigChanged();
    974972}
     
    979977void SpaceShip::previousWeaponConfig()
    980978{
    981   this->curWeaponPrimary    = (curWeaponPrimary + 1) % 3;
     979  this->curWeaponPrimary    = (this->curWeaponPrimary + 1) % 3;
    982980  this->weaponMan.changeWeaponConfig(this->curWeaponPrimary);
    983981  Playable::weaponConfigChanged();
    984982}
     983
     984void SpaceShip::hit(float damage, WorldEntity* killer)
     985{
     986  this->damage(killer->getDamage(),0);
     987  killer->collidesWith( this, this->getAbsCoor());
     988  //this->collidesWith(killer, this->getAbsCoor());
     989}
Note: See TracChangeset for help on using the changeset viewer.