Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2006, 8:00:52 PM (17 years ago)
Author:
nicolasc
Message:

some beautifications, nothing new

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/swarm_projectile.cc

    r10095 r10104  
    33   orxonox - the future of 3D-vertical-scrollers
    44
    5    Copyright (C) 2004 orx
     5   Copyright (C) 2004-2006 orx
    66
    77   This program is free software; you can redistribute it and/or modify
     
    1111
    1212   ### File Specific
    13    main-programmer: Silvan Nellen
     13   main-programmer: Marc Schaerrer, Nicolas Schlumberger
    1414   co-programmer:
    1515
     
    5858
    5959  this->physDamage = 200;
     60  this->elecDamage = 0;
    6061
    6162  this->trail = new Trail(2.5,4,.2, this);
     
    135136    this->destroy( entity );
    136137  this->hitEntity = entity;
    137   dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),0);
     138  dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
     139  this->destroy(NULL);
    138140}
    139141
     
    219221//     else
    220222//       tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity);
    221     Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized() * maxVelocity;
     223    Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor());
     224//     estTargetDir.slerpTo(this->velocity, 1);
    222225    this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time );
    223226  }
    224227  else
    225     if (likely(projectileVelocity != 0))
     228    if (likely(projectileVelocity != 0 || projectileVelocity != this->maxVelocity) )
    226229      this->velocity *= (this->maxVelocity / projectileVelocity); // set speed to max
    227230
     
    240243  this->lastDir = this->curDir;
    241244  this->curDir = this->velocity;
    242   if( (this->getAbsCoor() - this->target->getAbsCoor()).len() < 4)   // FIXME  Temp fake workaround for collision :)
     245  if( (this->getAbsCoor() - this->target->getAbsCoor()).len() < 1)   // FIXME  Temp fake workaround for collision :)
    243246  {
    244247    dynamic_cast<WorldEntity*>(target)->destroy( this);
     
    253256{
    254257
    255   printf("THIS SHOULD WORLk\n");
     258  printf("THIS SHOULD WORK!\n");
    256259
    257260  Projectile::destroy( killer );
     
    272275  glPushMatrix();
    273276
    274   Vector tmpDir = this->curDir *.5 + this->lastDir * .5;
     277  Vector tmpDir = this->curDir *.7 + this->lastDir * .3;
    275278
    276279  float matrix[4][4];
Note: See TracChangeset for help on using the changeset viewer.