Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/Makefile.am

    r5456 r5458  
    2727                  weapons/crosshair.cc \
    2828                  power_ups/power_up.cc \
    29                   power_ups/turret_power_up.cc
     29                  power_ups/turret_power_up.cc \
     30                  power_ups/laser_power_up.cc
    3031
    3132noinst_HEADERS = \
     
    5051                 weapons/crosshair.h \
    5152                 power_ups/power_up.h \
    52                  power_ups/turret_power_up.h
     53                 power_ups/turret_power_up.h \
     54                 power_ups/laser_power_up.h
    5355
    5456
  • trunk/src/world_entities/Makefile.in

    r5456 r5458  
    5858        weapon_manager.lo weapon.lo test_gun.lo turret.lo \
    5959        projectile.lo test_bullet.lo rocket.lo laser.lo crosshair.lo \
    60         power_up.lo turret_power_up.lo
     60        power_up.lo turret_power_up.lo laser_power_up.lo
    6161libORXworld_entities_la_OBJECTS =  \
    6262        $(am_libORXworld_entities_la_OBJECTS)
     
    6868@AMDEP_TRUE@    ./$(DEPDIR)/crosshair.Plo \
    6969@AMDEP_TRUE@    ./$(DEPDIR)/environment.Plo ./$(DEPDIR)/laser.Plo \
    70 @AMDEP_TRUE@    ./$(DEPDIR)/npc.Plo ./$(DEPDIR)/npc2.Plo \
    71 @AMDEP_TRUE@    ./$(DEPDIR)/player.Plo ./$(DEPDIR)/power_up.Plo \
     70@AMDEP_TRUE@    ./$(DEPDIR)/laser_power_up.Plo ./$(DEPDIR)/npc.Plo \
     71@AMDEP_TRUE@    ./$(DEPDIR)/npc2.Plo ./$(DEPDIR)/player.Plo \
     72@AMDEP_TRUE@    ./$(DEPDIR)/power_up.Plo \
    7273@AMDEP_TRUE@    ./$(DEPDIR)/projectile.Plo ./$(DEPDIR)/rocket.Plo \
    7374@AMDEP_TRUE@    ./$(DEPDIR)/satellite.Plo ./$(DEPDIR)/skybox.Plo \
     
    243244                  weapons/crosshair.cc \
    244245                  power_ups/power_up.cc \
    245                   power_ups/turret_power_up.cc
     246                  power_ups/turret_power_up.cc \
     247                  power_ups/laser_power_up.cc
    246248
    247249noinst_HEADERS = \
     
    266268                 weapons/crosshair.h \
    267269                 power_ups/power_up.h \
    268                  power_ups/turret_power_up.h
     270                 power_ups/turret_power_up.h \
     271                 power_ups/laser_power_up.h
    269272
    270273SUBDIRS = .          .
     
    343346@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Plo@am__quote@
    344347@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/laser.Plo@am__quote@
     348@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/laser_power_up.Plo@am__quote@
    345349@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/npc.Plo@am__quote@
    346350@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/npc2.Plo@am__quote@
     
    649653@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    650654@am__fastdepCXX_FALSE@  $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o turret_power_up.lo `test -f 'power_ups/turret_power_up.cc' || echo '$(srcdir)/'`power_ups/turret_power_up.cc
     655
     656laser_power_up.o: power_ups/laser_power_up.cc
     657@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT laser_power_up.o -MD -MP -MF "$(DEPDIR)/laser_power_up.Tpo" -c -o laser_power_up.o `test -f 'power_ups/laser_power_up.cc' || echo '$(srcdir)/'`power_ups/laser_power_up.cc; \
     658@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/laser_power_up.Tpo" "$(DEPDIR)/laser_power_up.Po"; else rm -f "$(DEPDIR)/laser_power_up.Tpo"; exit 1; fi
     659@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='power_ups/laser_power_up.cc' object='laser_power_up.o' libtool=no @AMDEPBACKSLASH@
     660@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/laser_power_up.Po' tmpdepfile='$(DEPDIR)/laser_power_up.TPo' @AMDEPBACKSLASH@
     661@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     662@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o laser_power_up.o `test -f 'power_ups/laser_power_up.cc' || echo '$(srcdir)/'`power_ups/laser_power_up.cc
     663
     664laser_power_up.obj: power_ups/laser_power_up.cc
     665@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT laser_power_up.obj -MD -MP -MF "$(DEPDIR)/laser_power_up.Tpo" -c -o laser_power_up.obj `if test -f 'power_ups/laser_power_up.cc'; then $(CYGPATH_W) 'power_ups/laser_power_up.cc'; else $(CYGPATH_W) '$(srcdir)/power_ups/laser_power_up.cc'; fi`; \
     666@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/laser_power_up.Tpo" "$(DEPDIR)/laser_power_up.Po"; else rm -f "$(DEPDIR)/laser_power_up.Tpo"; exit 1; fi
     667@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='power_ups/laser_power_up.cc' object='laser_power_up.obj' libtool=no @AMDEPBACKSLASH@
     668@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/laser_power_up.Po' tmpdepfile='$(DEPDIR)/laser_power_up.TPo' @AMDEPBACKSLASH@
     669@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     670@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o laser_power_up.obj `if test -f 'power_ups/laser_power_up.cc'; then $(CYGPATH_W) 'power_ups/laser_power_up.cc'; else $(CYGPATH_W) '$(srcdir)/power_ups/laser_power_up.cc'; fi`
     671
     672laser_power_up.lo: power_ups/laser_power_up.cc
     673@am__fastdepCXX_TRUE@   if $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT laser_power_up.lo -MD -MP -MF "$(DEPDIR)/laser_power_up.Tpo" -c -o laser_power_up.lo `test -f 'power_ups/laser_power_up.cc' || echo '$(srcdir)/'`power_ups/laser_power_up.cc; \
     674@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/laser_power_up.Tpo" "$(DEPDIR)/laser_power_up.Plo"; else rm -f "$(DEPDIR)/laser_power_up.Tpo"; exit 1; fi
     675@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='power_ups/laser_power_up.cc' object='laser_power_up.lo' libtool=yes @AMDEPBACKSLASH@
     676@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/laser_power_up.Plo' tmpdepfile='$(DEPDIR)/laser_power_up.TPlo' @AMDEPBACKSLASH@
     677@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     678@am__fastdepCXX_FALSE@  $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o laser_power_up.lo `test -f 'power_ups/laser_power_up.cc' || echo '$(srcdir)/'`power_ups/laser_power_up.cc
    651679
    652680mostlyclean-libtool:
  • trunk/src/world_entities/npc.cc

    r5451 r5458  
    2525#include "stdlibincl.h"
    2626#include "power_ups/turret_power_up.h"
     27#include "power_ups/laser_power_up.h"
    2728
    2829using namespace std;
     
    5455      State::getWorldEntityList()->add(powerUp);
    5556    }
     57    else if ((float)rand()/RAND_MAX < .3)
     58    {
     59      WorldEntity* powerUp = new LaserPowerUp();
     60      powerUp->setAbsCoor(this->getAbsCoor());
     61      State::getWorldEntityList()->add(powerUp);
     62    }
    5663    State::getWorldEntityList()->remove(this);
    5764
  • 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 */
  • trunk/src/world_entities/weapons/laser.cc

    r5457 r5458  
    4646  this->energyMax = 10;
    4747  this->remove();
    48   this->lifeSpan = 2;
     48  this->lifeSpan = 1.0;
    4949
    5050  this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
  • trunk/src/world_entities/weapons/test_gun.cc

    r5457 r5458  
    129129  this->setMaximumEnergy(1000, 100);
    130130  this->increaseEnergy(1000);
    131   this->setEmissionPoint(0,-100,0);
    132131  //this->minCharge = 2;
    133132
     
    186185  pj->setParent(NullParent::getInstance());
    187186
    188   pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*20);
     187  pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*50);
    189188
    190189  pj->setAbsCoor(this->getEmissionPoint());
Note: See TracChangeset for help on using the changeset viewer.