Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2007, 3:05:01 AM (17 years ago)
Author:
patrick
Message:

merged playability. but got strange bug

Location:
branches/playability.new
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability.new

    • Property svn:ignore
      •  

        old new  
        1010autom4te.cache
        1111aclocal.m4
         12tags
         13test.bmp
         14config.sub
         15config.guess
         16OrxonoxPlayability.kdevses
         17OrxonoxPlayability.kdevelop.pcs
  • branches/playability.new/src/world_entities/projectiles/projectile.cc

    r10013 r10362  
    2525#include "playable.h"
    2626
     27#include <cmath>
     28
    2729#include "debug.h"
    2830
     
    4648  this->subscribeReaction( CoRe::CREngine::CR_PHYSICS_FULL_WALK, Playable::staticClassID());
    4749
     50  this->physDamage = 0.0f;
     51  this->elecDamage = 0.0f;
    4852  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    4953}
     
    6064  */
    6165  //delete this->projectileModel;
     66}
     67
     68Projectile::Projectile (float pDamage, float eDamage, PNode* target) : WorldEntity()
     69{
     70  this->registerObject(this, Projectile::_objectList);
     71
     72  this->lifeCycle = 0.0;
     73  this->lifeSpan = 1.0f; /* sec */
     74  this->removeNode();
     75
     76  /* character attributes */
     77  this->setHealth(1.0f);
     78  this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
     79
     80  this->physDamage = pDamage;
     81  this->elecDamage = eDamage;
     82  this->target = target;
     83
     84  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     85}
     86
     87void Projectile::initialize(float pDamage, float eDamage, PNode* target)
     88{
     89  /* character attributes*/
     90  this->physDamage = pDamage;
     91  this->elecDamage = eDamage;
     92  this->target = target;
    6293}
    6394
     
    124155
    125156
     157void Projectile::collidesWith (WorldEntity* target, const Vector& location)
     158{
     159  dynamic_cast<SpaceShip*>(target)->damage(this->getPhysDamage(),this->getElecDamage());
     160//   this->destroy(NULL);
     161  this->destroy(target);
     162}
     163
     164
     165
    126166/**
    127167 * signal tick, time dependent things will be handled here
     
    130170void Projectile::tick (float dt)
    131171{
    132   Vector v = this->velocity * (dt);
    133   this->shiftCoor(v);
    134 
    135172  if (this->tickLifeCycle(dt))
    136173    this->destroy( NULL );
Note: See TracChangeset for help on using the changeset viewer.