Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 14, 2010, 11:20:16 AM (14 years ago)
Author:
dafrick
Message:

Some more documenting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/PickupSpawner.h

    r7494 r7540  
    3939
    4040#include <string>
     41
     42#include "tools/Timer.h"
     43
    4144#include "interfaces/Pickupable.h"
    42 #include "tools/Timer.h"
    4345
    4446#include "tools/interfaces/Tickable.h"
     
    4951    /**
    5052        @brief
    51             The PickupSpawner class is responsible for spawning pickups of a specific type.
    52             Forthermore it can be specified how long the time interval between spawning two items is and how many pickups are spawned at maximum, amongst other things.
     53            The PickupSpawner class is responsible for spawning @ref orxonox::Pickupable "Pickupables" of a specific type.
     54            Furthermore it can be specified how long the time interval between spawning two items is and how many @ref orxonox::Pickupable "Pickupables" are spawned at maximum, amongst other things. The parameters that can be used to further specify the behaviour of the PickupSpawner are:
     55            - The <b>triggerDistance</b> can be used to specify how far away an entity has to be to still trigger the PickupSPawner (and thus receive a @ref orxonox::Pickupable "Pickupable" form it). The default is 10.
     56            - The <b>respawnTime</b> is the time in seconds that passes until the PickupSpawner is enabled again, after having spawned a @ref orxonox::Pickupable "Pickupable". The default is 0.
     57            - The <b>maxSpawnedItems</b> is the number of @ref orxonox::Pickupable "Pickupables" that are spawned by this PickupSpawner at the most. The default is -1, which denotes infinity.
     58
     59            A PickupSpawner is created in XML, which can be done in the following fashion:
     60            @code
     61            <PickupSpawner position="-100,0,-100" respawnTime="30" maxSpawnedItems="10">
     62                <pickup>
     63                    <SomePickup >
     64                </pickup>
     65            </PickupSpawner>
     66            @endcode
     67            As we can see, since the PickupSpawner is a StaticEntity, it also has spatial coordinates. We can also see, that the type of @ref orxonox::Pickupable "Pickupable" which is spawned hast to be specified as well.
    5368
    5469        @author
     
    5671        @author
    5772            Damian 'Mozork' Frick
     73
     74        @ingroup Pickup
    5875    */
    5976    class _PickupExport PickupSpawner : public StaticEntity, public Tickable
     
    6683            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
    6784            virtual void changedActivity(); //!< Invoked when activity has changed (set visibilty).
    68             virtual void tick(float dt);
     85            virtual void tick(float dt); //!< Tick, checks if any Pawn is close enough to trigger.
    6986
    7087            /**
Note: See TracChangeset for help on using the changeset viewer.