Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12131


Ignore:
Timestamp:
Nov 29, 2018, 9:12:53 AM (5 years ago)
Author:
linggj
Message:

it works but needs some beuty to be added

Location:
code/branches/WorldMap_HS18
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw

    r12110 r12131  
    1616
    1717<Level
    18 gametype = StoryMode
     18gametype = Deathmatch
    1919>
    2020
     
    3131    skybox       = "Orxonox/Starbox"
    3232  >
    33    <StoryModeController position="0,0,0" collisionType="dynamic">
     33   <StoryModeController position="0,0,0" collisionType="dynamic" mass=42000000 >
    3434
    3535          <attached>
    36               <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="true" />
     36              <Model position="0,0,0" mesh="assff.mesh" scale=20  visible="true" />
    3737          </attached>
    38 
     38          <CameraPosition position="0,0,1000" direction="0, -1, 0" drag=false />
    3939          <collisionShapes>
    4040              <BoxCollisionShape position="0,0,0" halfExtents="3,1,10" />
     
    5050    </MovableEntity> -->
    5151   
     52   
     53   
     54
    5255    <StaticEntity position="0,0,0" direction="0,0,-1" >
    5356      <attached>
     57
     58        <Model name="a" position="550,300,0" mesh="planets/moon.mesh" scale=100 visible="true" />
     59        <Billboard colour="1,0,0.05" position="550,300,-80"  material="Flares/lensflare" scale=4.5 />
    5460
    5561        <Model name="a" position="600,370,0" mesh="planets/moon.mesh" scale=100 visible="false" />
     
    5763       
    5864         <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="false" orientation="-0.015,0.091,0.038,-0.995"/>
     65       
    5966        <Billboard colour="1,1,0.05" position="600,370,-80"  material="Flares/lensflare" scale=4.5 />
    6067       
    6168
    62         <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100  visible="false"/>
     69        <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100  visible="true"/>
    6370         <Model position="50,300,-250" mesh="assff.mesh" scale=20  visible="false" orientation="-0.015,0.091,0.038,-0.995"/>
    6471        <Billboard colour="1,1,0.05" position="100,350,-330"  material="Flares/lensflare" scale=4.5 />
     
    9299    <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"/>
    93100
    94     <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" pawndesign=StoryMode />
     101    <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" spawnclass=StoryModeController pawndesign=StoryMode />
    95102   
    96103   
  • code/branches/WorldMap_HS18/data/overlays/StoryModeHUD.oxo

    r11783 r12131  
    1111  </OverlayGroup>
    1212</Template>
     13  <Template name="spectatorhud">
     14  <OverlayGroup name = "spectatorhud" scale = "1, 1">
     15  </OverlayGroup>
     16</Template>
  • code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc

    r12110 r12131  
    5656        case 6:
    5757            coord.x= 0;
    58             coord.y = 900;
     58            coord.y = -900;
    5959            coord.z = -1500;
    6060            break;
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc

    r12110 r12131  
    2929#include "StoryModeController.h"
    3030
     31
    3132#include "core/CoreIncludes.h"
    3233#include "worldentities/ControllableEntity.h"
     
    3435#include "SMCoord.h"
    3536#include "core/XMLPort.h"
     37#include "gamestates/GSLevel.h"
    3638namespace orxonox
    3739{
     
    4648        moveBackward_=false;                     
    4749        boostPressed_=false;
    48        
     50        dtime_=50;
    4951
    5052     
     
    5658
    5759    }
    58 
     60    //void StoryModeController:: switchCamera(){};
    5961    void StoryModeController::updatePosition(){
    6062        Vector3 pos = selectedPos_->get3dcoordinate();
     
    6769    void StoryModeController::tick(float dt)
    6870    {
    69         orxout(internal_error) << "Hi" << endl;
     71        //orxout(internal_error) << "Hi" << endl;
    7072        SUPER(StoryModeController, tick, dt);
    7173        time_ +=dt;
     74           Camera* camera = this->getCamera();
     75           
     76       
    7277
    73         if(moveForward_ == true){
    74             moveForward_ = false;
    75             selectedPos_->set(selectedPos_->getIndex()+1);
    76             updatePosition();
    77         }
    78         if(moveBackward_ == true){
    79                 moveBackward_ = false;
    80                 selectedPos_->set(selectedPos_->getIndex()-1);
     78        if(time_>= dtime_*dt){
     79           
     80            time_=0;       
     81         
     82            if(moveForward_ == true){
     83                orxout(internal_error) << "Position update" << endl;
     84                moveForward_ = false;
     85                selectedPos_->set(selectedPos_->getIndex()+1);
    8186                updatePosition();
    82            }
    83            if(boostPressed_ == true){
    84                 boostPressed_ = false;
    85                 chooseGame();
    86            }
    87        
     87            }
     88
     89            if(moveBackward_ == true){
     90                orxout(internal_error) << "Position update" << endl;
     91                    moveBackward_ = false;
     92                    selectedPos_->set(selectedPos_->getIndex()-1);
     93                    updatePosition();
     94               }
     95
     96               if(boostPressed_ == true){
     97                    boostPressed_ = false;
     98                    chooseGame();
     99               }
     100
     101               
     102             if (camera != nullptr)
     103            {
     104
     105                Vector3 epos = selectedPos_->get3dcoordinate();
     106                orxout(internal_error) << "ex: "<< epos.x <<" ey: "<< epos.y << " ez: " << epos.z<< endl;
     107                camera->setPosition(-(epos.x),-(epos.y),-(epos.z)+1000);
     108                camera->setOrientation(Vector3::UNIT_Z, Degree(0));
     109
     110            }
     111       }
    88112       
    89113    }
     
    91115    void StoryModeController::moveFrontBack(const Vector2& value)
    92116    {
    93           orxout(internal_error) << "moveFrontBack" << endl;         
     117          // orxout(internal_error) << "moveFrontBack" << endl;         
    94118    }
    95119
    96120    void StoryModeController::chooseGame()
    97121    {
    98            //findLevel(selectedPos_->getIndex());           
     122       int ind = selectedPos_->getIndex();
     123       std::string name =   "changeGame ";
     124       switch(ind){
     125            case 0:
     126            name = name + "pong.oxw";
     127                break;
     128            case 1:
     129               
     130                break;
     131            case 2:
     132               
     133                break;
     134            case 3:
     135               
     136                break;
     137            case 4:
     138               
     139                break;
     140            case 5:
     141               
     142                break;
     143            case 6:
     144               
     145                break;
     146            case 7:
     147               
     148                break;
     149            case 8:
     150               
     151                break;
     152            default:
     153                break;   
     154       } 
     155       CommandExecutor::execute(name);
     156       /*for (GSLevel* level : ObjectList<GSLevel>())
     157            level->changeGame(name);*/
     158       //hideAllMenuSheets();     
    99159    }
    100160
     
    102162    void StoryModeController::moveRightLeft(const Vector2& value)
    103163    {
    104         orxout(internal_error) << "RightLeft" << endl;
    105         if (value.x>0){
    106             moveForward_ =false;
    107             moveBackward_ =true;
    108         } else {
    109             moveBackward_ = false;
    110             moveForward_ = true;
     164        if(!moveForward_&&!moveBackward_){
     165            if (value.x>0){
     166                orxout(internal_error) << "Right" << endl;
     167                moveForward_ =true;
     168                moveBackward_ =false;
     169            } else {
     170                 orxout(internal_error) << "Left" << endl;
     171                moveBackward_ = true;
     172                moveForward_ = false;
     173            }
    111174        }
    112175
     
    114177
    115178    void StoryModeController::rotateYaw(const Vector2& value){
    116         orxout(internal_error) << "RightLeft" << endl;
     179        //orxout(internal_error) << "RightLeft" << endl;
    117180    }
    118181    void StoryModeController::rotatePitch(const Vector2& value){
    119         orxout(internal_error) << "RightLeft" << endl;
     182        //orxout(internal_error) << "RightLeft" << endl;
    120183    }
    121184    void StoryModeController::rotateRoll(const Vector2& value){
    122         orxout(internal_error) << "RightLeft" << endl;
     185        //orxout(internal_error) << "RightLeft" << endl;
    123186    }
    124187    void StoryModeController::fire(unsigned int a){}
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h

    r12110 r12131  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
     33#include "core/EventIncludes.h"
     34#include "core/command/Executor.h"
     35#include "core/config/ConfigValueIncludes.h"
     36#include "core/XMLPort.h"
    3437#include <vector>
    3538#include "tools/interfaces/Tickable.h"
     
    3740#include "worldentities/pawns/SpaceShip.h"
    3841#include "SMCoord.h"
     42
     43//#include <gtest/gtest.h>
     44#include "core/class/Identifier.h"
     45#include "core/class/IdentifierManager.h"
     46#include "core/command/ConsoleCommandIncludes.h"
     47#include "core/command/CommandExecutor.h"
     48#include "core/object/Destroyable.h"
     49#include "core/module/ModuleInstance.h"
    3950
    4051namespace orxonox
     
    5566            virtual void fired(unsigned int firemode) override;
    5667            virtual void boost(bool bBoost) override;
     68            //virtual void switchCamera() override;
     69
    5770            virtual void setLocation(int index);
    5871            bool moveRight_ ;
     
    6275            virtual void updatePosition();                       
    6376            float time_;
     77            int dtime_;
    6478            bool moveForward_;
    6579            bool moveBackward_;                     
Note: See TracChangeset for help on using the changeset viewer.