Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 11, 2010, 4:30:30 PM (15 years ago)
Author:
dafrick
Message:

Added additional pickup (TestPickup), and did some bug $fixing.

Location:
code/branches/pickup3/src/modules/pickup
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/modules/pickup/DroppedPickup.cc

    r6475 r6512  
    4040namespace orxonox
    4141{
     42   
     43    CreateFactory(DroppedPickup);
     44   
    4245    /**
    4346    @brief
     
    6366        The distance at which the PickupSpawner triggers. Default is 10.
    6467    */
    65     DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 0, 1)
     68    DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 10, 1)
    6669    {   
    6770        RegisterObject(DroppedPickup);
     
    7073       
    7174        this->setPosition(position);
     75        this->setActive(false);
     76        this->startRespawnTimer();
    7277    }
    7378
  • code/branches/pickup3/src/modules/pickup/PickupPrereqs.h

    r6496 r6512  
    7676    //items
    7777    class HealthPickup;
     78    class TestPickup;
    7879   
    7980}
  • code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc

    r6484 r6512  
    154154    {
    155155        StaticEntity* representation = new StaticEntity(spawner);
    156         //TODO: Nicer...
    157         Billboard* billboard = new Billboard(spawner);
    158         billboard->setColour(ColourValue(1.0, 0.0, 0.0));
    159         billboard->setMaterial("Examples/Flare");
    160         representation->attach(billboard);
     156        Billboard* sphere = new Billboard(spawner);
     157        sphere->setColour(ColourValue(0.95, 0.85, 0.27));
     158        sphere->setMaterial("Sphere2");
     159        sphere->setScale(0.1);
     160        Billboard* icon = new Billboard(spawner);
     161        icon->setColour(ColourValue(0.89, 0.79, 0.08));
     162        icon->setMaterial("Asterix");
     163        icon->setScale(0.5);
     164        sphere->attach(icon);
     165        representation->attach(sphere);
    161166        return representation;
    162167    }
  • code/branches/pickup3/src/modules/pickup/PickupSpawner.cc

    r6499 r6512  
    216216        {
    217217            //TODO: Nicer? Does this even work?
    218             this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
     218            this->startRespawnTimer();
    219219
    220220            this->setActive(false);
     
    227227            this->destroy();
    228228        }
     229    }
     230   
     231    /**
     232    @brief
     233        Starts the respawn timer.
     234    */
     235    void PickupSpawner::startRespawnTimer(void)
     236    {
     237        this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
    229238    }
    230239   
  • code/branches/pickup3/src/modules/pickup/PickupSpawner.h

    r6496 r6512  
    101101        protected:
    102102            void decrementSpawnsRemaining(void); //!< Decrements the number of remaining spawns.
     103                       
     104            void startRespawnTimer(void);
    103105           
    104106            virtual Pickupable* getPickup(void); //!< Creates a new Pickupable.
  • code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt

    r6474 r6512  
    11ADD_SOURCE_FILES(PICKUP_SRC_FILES
    22  HealthPickup.cc
     3  TestPickup.cc
    34)
Note: See TracChangeset for help on using the changeset viewer.