Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12106 for code


Ignore:
Timestamp:
Nov 14, 2018, 11:59:52 AM (5 years ago)
Author:
linggj
Message:

Story Mode Controller added again as a controllabel entitz

Location:
code/branches/WorldMap_HS18
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/WorldMap_HS18/data/gui/layouts/CampaignMenu.layout

    r12101 r12106  
    88        <Property name="BackgroundEnabled" value="False" />
    99             
    10         <Window name="ForwardText" type="MenuWidgets/Button">
    11             <Property name="Text" value="Forward" />
    12             <Property name="Visible" value="True" />
    13             <Property name="Area" value="{{0.1,0},{0.6,0},{0.3,0},{0.65,0}}" />
    14             <Event function="CampaignMenu.forwardButton_clicked" name="Clicked" />
     10
     11        <Window name="RightButton" type="MenuWidgets/Button">
     12            <Property name="Text" value="F" />
     13            <Property name="MaxSize" value="{{1,0},{1,0}}" />
     14            <Property name="Area" value="{{0.350,0},{0.9,0},{0.45,0},{0.95,0}}" />
     15           
    1516        </Window>
    1617
    17         <Window name="ForwardButton" type="MenuWidgets/JuuButton">
    18             <Property name="Visible" value="True" />
     18         <Window name="LeftButton" type="MenuWidgets/Button">
     19            <Property name="Text" value="B" />
    1920            <Property name="MaxSize" value="{{1,0},{1,0}}" />
    20             <Property name="Area" value="{{0.1,0},{0.75,0},{0.25,0},{0.95,0}}" />
    21             <Event function="CampaignMenu.forwardButton_clicked" name="Clicked" />
     21            <Property name="Area" value="{{0.55,0},{0.9,0},{0.65,0},{0.95,0}}" />
     22           
     23        </Window>
     24
     25        <Window name="SelectButton" type="MenuWidgets/Button">
     26            <Property name="Text" value="Play" />
     27            <Property name="MaxSize" value="{{1,0},{1,0}}" />
     28            <Property name="Area" value="{{0.45,0},{0.9,0},{0.55,0},{0.95,0}}" />
     29           
    2230        </Window>
    2331
  • code/branches/WorldMap_HS18/data/gui/scripts/CampaignMenu.lua

    r12101 r12106  
    22
    33local P = createMenuSheet("CampaignMenu")
     4
    45
    56function P:onShow()
     
    7576end
    7677
    77 function P.forwardButton_clicked(e)
    78     P.loadMap()
    79 end
     78
     79
    8080
    8181function P.Mission1Button_clicked(e)
     
    124124
    125125function P.loadMap()
    126     orxonox.execute("change Game  NC_StoryModeLevel")
     126    orxonox.execute("changeGame  dynamicMatch.oxw")
     127     hideAllMenuSheets()
    127128end
    128129
  • code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw

    r12101 r12106  
    2222    <Template link=lodtemplate_default />
    2323  </templates>
     24
     25  <Template name=selectertemplate>
     26  <StoryModeController team=0>
     27    <attache>
     28     <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="true" orientation="-0.015,0.091,0.038,-0.995"/>
     29   </attache>
     30 </StoryModeController>
     31</Template>
     32
    2433  <?lua include("includes/notifications.oxi") ?>
    2534<?lua
     
    8392
    8493
     94
    8595    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
    8696
  • code/branches/WorldMap_HS18/src/orxonox/controllers/CMakeLists.txt

    r12059 r12106  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
    22  Controller.cc
     3  StoryModeController.cc
     4  SMCoord.cc
    35  HumanController.cc
    46  NewHumanController.cc
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc

    r12101 r12106  
    3131#include "core/CoreIncludes.h"
    3232#include "worldentities/ControllableEntity.h"
     33#include "SMCoord.h"
    3334
    3435namespace orxonox
     
    3637    RegisterClass(StoryModeController);
    3738
    38    StoryModeController::StoryModeController(Context* context) : Pawn(context)
     39   StoryModeController::StoryModeController(Context* context) : ControllableEntity(context)
    3940    {
    4041        RegisterObject(StoryModeController);
    41         moveRight_ = false;
    42         moveLeft_ = false;
    43         //this->setAccuracy(50);
     42        float time_;
     43        moveForward_=false;
     44        moveBackward_=false;                     
     45        boostPressed_=false;
     46        setPosition(0);
     47     
    4448    }
    4549
    4650    StoryModeController::~StoryModeController()
    4751    {
    48         /*for (WorldEntity* waypoint : this->waypoints_)
    49         {
    50             if(waypoint)
    51                 waypoint->destroy();
    52         }*/
     52       
     53
     54    }
     55
     56    void StoryModeController::updatePosition(){
     57
     58    }
     59    void StoryModeController::setPosition(int index){
    5360
    5461    }
     
    5764    {
    5865        orxout(internal_error) << "Hi" << endl;
    59        
    60         /*if (!this->isActive())
    61             return;
    62 
    63         if (this->waypoints_.size() == 0 || !this->getControllableEntity())
    64             return;
    65 
    66         if (false /* this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_*///)
    67             //this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
    68 
    69         //this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
     66       SUPER(StoryModeController, tick, dt);
     67       time_ +=dt;
     68       
     69       
    7070    }
    7171
    7272    void StoryModeController::moveFrontBack(const Vector2& value)
    7373    {
    74         orxout(internal_error) << "FrontBack" << endl;
    75 
    76            
     74                   
    7775    }
    7876    void StoryModeController::moveRightLeft(const Vector2& value)
     
    8078        orxout(internal_error) << "RightLeft" << endl;
    8179        if (value.x>0){
    82             moveRight_ =false;
    83             moveLeft_ =true;
    84 
    85         }
     80            moveForward_ =false;
     81            moveBackward_ =true;
     82        } else {
     83            moveBackward_ = false;
     84            moveForward_ = true;
     85        }
    8686
    8787    }
     
    9292    void StoryModeController::fire(unsigned int a){}
    9393    void StoryModeController::fired(unsigned int b){}
    94     void StoryModeController::boost(bool bBoost){}
     94    void StoryModeController::boost(bool bBoost){
     95        boostPressed_ = true;
     96    }
    9597}
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h

    r12101 r12106  
    3939namespace orxonox
    4040{
    41     class _OrxonoxExport StoryModeController : public Pawn
     41    class _OrxonoxExport StoryModeController : public ControllableEntity
    4242    {
    4343        public:
     
    5454            virtual void fired(unsigned int firemode) override;
    5555            virtual void boost(bool bBoost) override;
     56            virtual void setPosition(int index);
    5657            bool moveRight_ ;
    5758            bool moveLeft_ ;
    58         protected:
     59        private:
     60            virtual void updatePosition();                       
     61            float time_;
     62            bool moveForward_;
     63            bool moveBackward_;                     
     64            bool boostPressed_;
    5965
    6066    };
Note: See TracChangeset for help on using the changeset viewer.