Changeset 7547 for code/trunk/src/modules/pickup/items/SpeedPickup.h
- Timestamp:
- Oct 16, 2010, 12:37:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/items/SpeedPickup.h
r7493 r7547 39 39 40 40 #include <string> 41 #include "worldentities/pawns/Pawn.h"42 #include "worldentities/StaticEntity.h"43 41 44 42 #include "pickup/Pickup.h" … … 50 48 A Pickup which can manipulate the Speed of a Pawn. 51 49 52 There are 4 parameters that can be cosen: 53 - The @b speed @b multiplier 54 - The @b additional (forward) @b speed 55 - The @b activation @b type 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it. 56 - The @b duration The activation time of the pickup. 50 There are 5 parameters that can be cosen: 51 - The @b speedMultiply, specifies a factor by which the Spaceships speed is multiplied. The default is 1. 52 - The @b speedAdd, specifies a value that is added to the speed of the Spaceship. The default is 0. 53 - The @b activationType <em>immediate</em> or <em>onUse</em>, defines if the SpeedPickup is used when it's picked up or only after the player chooses to use it. The default is <em>immediate</em>. 54 - The @b durationType Can be either <em>once</em> or <em>continuous</em>. For <em>once</em> the SpeedPickup is just active for as long as it is used, for <em>continuous</em> the SpeedPickup is active only for the specified duration. The default is <em>once</em>. 55 - The @b duration The time in seconds the SpeedPickup is active at the most. The default is 0. 56 57 An example, how a SpeedPickup could be defined in XML could be: 58 @code 59 <SpeedPickup 60 speedMultiply = 2.0 61 speedAdd = 10.0 62 activationType = "immediate" 63 durationType = "continuous" 64 duration = 30.0 65 /> 66 @endcode 57 67 58 68 @author 59 69 Eric Beier 70 71 @ingroup PickupItems 60 72 */ 61 73 class _PickupExport SpeedPickup : public Pickup … … 71 83 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 72 84 73 inline float getDuration(void) 85 /** 86 @brief Get the duration, the time the SpeedPickup is active. 87 @return Returns the duration in seconds. 88 */ 89 inline float getDuration(void) const 74 90 { return this->duration_; } 75 inline float getSpeedAdd(void) 91 /** 92 @brief Get the value that is added to the speed of the Pawn. 93 @return Returns the speedAdd. 94 */ 95 inline float getSpeedAdd(void) const 76 96 { return this->speedAdd_; } 77 inline float getSpeedMultiply(void) 97 /** 98 @brief Get the factor by wich the speed of the Pawn is multplied. 99 @return Returns the speedMultiply. 100 */ 101 inline float getSpeedMultiply(void) const 78 102 { return this->speedMultiply_; } 79 103 80 104 protected: 81 105 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. 82 83 106 void pickupTimerCallback(void); //!< Function that gets called when timer ends. 84 107 85 void setDuration(float duration); 86 void setSpeedAdd(float speedAdd); 87 void setSpeedMultiply(float speedMultiply); 108 void setDuration(float duration); //!< Sets the duration. 109 void setSpeedAdd(float speedAdd); //!< Sets the SpeedAdd, the value that is added to the speed of the Pawn. 110 void setSpeedMultiply(float speedMultiply); //!< Sets the speedMultiply, the factor by which the speed of the Pawn is multiplied. 88 111 89 112 private: … … 93 116 Timer durationTimer_; //!< Timer. 94 117 95 float duration_; //!< The health that is transferred to the Pawn.96 float speedAdd_; 97 float speedMultiply_; 118 float duration_; //!< The time in seconds for which the SpeedPickup stays active. 119 float speedAdd_; //!< The value that is added to the speed of the Pawn. 120 float speedMultiply_; //!< The factor by which the speed of the Pawn is multiplied. 98 121 }; 99 122 }
Note: See TracChangeset
for help on using the changeset viewer.