- Timestamp:
- Jun 18, 2009, 10:00:15 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/orxonox/objects/controllers/PongAI.cc
r3176 r3192 39 39 CreateUnloadableFactory(PongAI); 40 40 41 const static float MAX_REACTION_TIME = 0.4 ;41 const static float MAX_REACTION_TIME = 0.4f; 42 42 43 43 PongAI::PongAI(BaseObject* creator) : Controller(creator) … … 49 49 this->ballEndPosition_ = 0; 50 50 this->randomOffset_ = 0; 51 this->relHysteresisOffset_ = 0.02 ;52 this->strength_ = 0.5 ;51 this->relHysteresisOffset_ = 0.02f; 52 this->strength_ = 0.5f; 53 53 this->movement_ = 0; 54 54 this->oldMove_ = 0; … … 171 171 172 172 // The position shouln't be larger than 0.5 (50% of the bat-length from the middle is the end) 173 position *= 0.48 ;173 position *= 0.48f; 174 174 175 175 // Both sides are equally probable … … 190 190 191 191 // Calculate bounces 192 for (float limit = 0.35 ; limit < this->strength_ || this->strength_ > 0.99; limit += 0.4)192 for (float limit = 0.35f; limit < this->strength_ || this->strength_ > 0.99f; limit += 0.4f) 193 193 { 194 194 // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI
Note: See TracChangeset
for help on using the changeset viewer.