Changeset 7540 for code/trunk/src/modules/pickup/PickupSpawner.h
- Timestamp:
- Oct 14, 2010, 11:20:16 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupSpawner.h
r7494 r7540 39 39 40 40 #include <string> 41 42 #include "tools/Timer.h" 43 41 44 #include "interfaces/Pickupable.h" 42 #include "tools/Timer.h"43 45 44 46 #include "tools/interfaces/Tickable.h" … … 49 51 /** 50 52 @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. 53 68 54 69 @author … … 56 71 @author 57 72 Damian 'Mozork' Frick 73 74 @ingroup Pickup 58 75 */ 59 76 class _PickupExport PickupSpawner : public StaticEntity, public Tickable … … 66 83 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PickupSpawner through XML. 67 84 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. 69 86 70 87 /**
Note: See TracChangeset
for help on using the changeset viewer.