Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 4, 2014, 9:53:50 PM (10 years ago)
Author:
landauf
Message:

simplified the boost command in HumanController by using the new keybind mode 'OnPressAndRelease'. depending on the command's argument the boost is started or stopped.
this also fixes a bug: boost didn't work if the frame-rate was too low or the game speed too high because boostingTimeout_ ended before the next tick

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/controllers/HumanController.h

    r9667 r9979  
    6565            static void reload();
    6666
    67             static void keepBoost(); // Static method, keeps boosting.
    68             /**
    69             @brief Check whether the HumanController is in boosting mode.
    70             @return Returns true if it is, false if not.
    71             */
    72             inline bool isBoosting(void)
    73                 { return this->boosting_; }
    74             void keepBoosting(void);
    75             void terminateBoosting(void);
     67            static void boost(const Vector2& value); // Static method, controls boosting.
     68            void startBoosting(void);
     69            void stopBoosting(void);
    7670
    7771
     
    107101            bool controlPaused_;
    108102
    109         private:
    110             bool boosting_; // Whether the HumanController is in boosting mode or not.
    111             Timer boostingTimeout_; // A timer to check whether the player is no longer boosting.
    112             static const float BOOSTING_TIME; // The time after it is checked, whether the player is no longer boosting.
    113 
    114103    }; // tolua_export
    115104} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.