Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 15, 2009, 11:04:39 PM (15 years ago)
Author:
scheusso
Message:

god mode hack for presentation

Location:
code/branches/presentation2/src/orxonox/controllers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/controllers/Controller.cc

    r6108 r6356  
    4141        this->player_ = 0;
    4242        this->controllableEntity_ = 0;
     43        this->bGodMode_ = false;
    4344    }
    4445
  • code/branches/presentation2/src/orxonox/controllers/Controller.h

    r6295 r6356  
    5151
    5252            virtual inline void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {};
     53           
     54            void setGodMode( bool mode ){ this->bGodMode_ = mode; }
     55            bool getGodMode(){ return this->bGodMode_; }
    5356
    5457            inline ControllableEntity* getControllableEntity() const
     
    7073            PlayerInfo* player_;
    7174            ControllableEntity* controllableEntity_;
     75        private:
     76            bool bGodMode_;
    7277    };
    7378}
  • code/branches/presentation2/src/orxonox/controllers/HumanController.cc

    r6195 r6356  
    5454    SetConsoleCommand(HumanController, mouseLook,     true);
    5555    SetConsoleCommand(HumanController, suicide,       true);
     56    SetConsoleCommand(HumanController, toggleGodMode, true);
    5657    SetConsoleCommand(HumanController, addBots,       true).defaultValues(1);
    5758    SetConsoleCommand(HumanController, killBots,      true).defaultValues(0);
     
    209210    }
    210211
     212    void HumanController::toggleGodMode()
     213    {
     214        HumanController::getLocalControllerSingleton()->setGodMode( !HumanController::getLocalControllerSingleton()->getGodMode() );
     215    }
     216
    211217    void HumanController::useItem()
    212218    {
  • code/branches/presentation2/src/orxonox/controllers/HumanController.h

    r6199 r6356  
    7474
    7575            static void suicide();
     76            static void toggleGodMode();
    7677
    7778            static void addBots(unsigned int amount);
Note: See TracChangeset for help on using the changeset viewer.