Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5458 in orxonox.OLD for trunk/src/world_entities/power_ups


Ignore:
Timestamp:
Oct 30, 2005, 1:52:29 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: a second power-up (lasers)

Location:
trunk/src/world_entities/power_ups
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/power_ups/laser_power_up.cc

    r5449 r5458  
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1717
    18 #include "turret_power_up.h"
     18#include "laser_power_up.h"
    1919#include "factory.h"
    2020#include "state.h"
     
    2525using namespace std;
    2626
    27 CREATE_FACTORY(TurretPowerUp);
     27CREATE_FACTORY(LaserPowerUp);
    2828
    29 TurretPowerUp::TurretPowerUp ()
     29LaserPowerUp::LaserPowerUp ()
    3030{
    3131  this->init();
    3232}
    3333
    34 TurretPowerUp::TurretPowerUp(const TiXmlElement* root)
     34LaserPowerUp::LaserPowerUp(const TiXmlElement* root)
    3535{
    3636  this->init();
     
    4040
    4141
    42 TurretPowerUp::~TurretPowerUp ()
     42LaserPowerUp::~LaserPowerUp ()
    4343{
    4444  delete this->sphereModel;
     
    4747
    4848
    49 void TurretPowerUp::init()
     49void LaserPowerUp::init()
    5050{
    51   this->setClassID(CL_TURRET_POWER_UP, "TurretPowerUp");
    52   this->loadModelWithScale("models/guns/turret1.obj", 2.0);
     51  this->setClassID(CL_LASER_POWER_UP, "LaserPowerUp");
     52  this->loadModelWithScale("models/guns/test_gun.obj", 2.0);
    5353
    5454  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
    5555  this->sphereMaterial = new Material;
    5656  this->sphereMaterial->setTransparency(.1);
    57   this->sphereMaterial->setDiffuse(.1, .1, .8);
     57  this->sphereMaterial->setDiffuse(.7, .7, .1);
    5858
    5959  this->rotation = Vector(0,1,0);
     
    6363
    6464
    65 void TurretPowerUp::loadParams(const TiXmlElement* root)
     65void LaserPowerUp::loadParams(const TiXmlElement* root)
    6666{
    6767  static_cast<PowerUp*>(this)->loadParams(root);
     
    7676 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
    7777 */
    78 void TurretPowerUp::collidesWith(WorldEntity* entity, const Vector& location)
     78void LaserPowerUp::collidesWith(WorldEntity* entity, const Vector& location)
    7979{
    8080 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     
    8989 * Handle all stuff that should update with time inside this method (movement, animation, etc.)
    9090*/
    91 void TurretPowerUp::tick(float dt)
     91void LaserPowerUp::tick(float dt)
    9292{
    9393  this->shiftDir(Quaternion(dt, this->rotation));
     
    102102 * Just override this function with whatever you want to be drawn.
    103103*/
    104 void TurretPowerUp::draw()
     104void LaserPowerUp::draw()
    105105{  glMatrixMode(GL_MODELVIEW);
    106106  glPushMatrix();
  • trunk/src/world_entities/power_ups/laser_power_up.h

    r5449 r5458  
    11/*!
    2  * @file turret_power_up.h
     2 * @file laser_power_up.h
    33 * @brief A class representing a PowerUp in the world.
    44*/
    55
    6 #ifndef _TURRET_POWER_UP_H
    7 #define _TURRET_POWER_UP_H
     6#ifndef _LASER_POWER_UP_H
     7#define _LASER_POWER_UP_H
    88
    99#include "power_up.h"
    1010
    11 class TurretPowerUp : public PowerUp {
     11class LaserPowerUp : public PowerUp {
    1212
    1313 public:
    14   TurretPowerUp();
    15   TurretPowerUp(const TiXmlElement* root);
    16   virtual ~TurretPowerUp ();
     14  LaserPowerUp();
     15  LaserPowerUp(const TiXmlElement* root);
     16  virtual ~LaserPowerUp ();
    1717
    18   virtual void TurretPowerUp::collidesWith(WorldEntity* entity, const Vector& location);
     18  virtual void LaserPowerUp::collidesWith(WorldEntity* entity, const Vector& location);
    1919  virtual void tick(float dt);
    2020  virtual void draw();
     
    3232};
    3333
    34 #endif /* _TURRET_POWER_UP_H */
     34#endif /* _LASER_POWER_UP_H */
Note: See TracChangeset for help on using the changeset viewer.