/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Fabian 'x3n' Landau * Co-authors: * ... * */ #include "StoryModeController.h" #include "core/CoreIncludes.h" #include "worldentities/ControllableEntity.h" #include "graphics/Camera.h" #include "SMCoord.h" #include "core/XMLPort.h" namespace orxonox { RegisterClass(StoryModeController); StoryModeController::StoryModeController(Context* context) : SpaceShip(context) { RegisterObject(StoryModeController); float time_; selectedPos_ = new SMCoord(0); moveForward_= false; moveBackward_=false; boostPressed_=false; } StoryModeController::~StoryModeController() { delete selectedPos_; selectedPos_ = nullptr; } void StoryModeController::updatePosition(){ Vector3 pos = selectedPos_->get3dcoordinate(); setPosition(pos); } void StoryModeController::setLocation(int index){ selectedPos_->set(index); } void StoryModeController::tick(float dt) { orxout(internal_error) << "Hi" << endl; SUPER(StoryModeController, tick, dt); time_ +=dt; if(moveForward_ == true){ moveForward_ = false; selectedPos_->set(selectedPos_->getIndex()+1); updatePosition(); } if(moveBackward_ == true){ moveBackward_ = false; selectedPos_->set(selectedPos_->getIndex()-1); updatePosition(); } if(boostPressed_ == true){ boostPressed_ = false; chooseGame(); } } void StoryModeController::moveFrontBack(const Vector2& value) { orxout(internal_error) << "moveFrontBack" << endl; } void StoryModeController::chooseGame() { //findLevel(selectedPos_->getIndex()); } void StoryModeController::moveRightLeft(const Vector2& value) { orxout(internal_error) << "RightLeft" << endl; if (value.x>0){ moveForward_ =false; moveBackward_ =true; } else { moveBackward_ = false; moveForward_ = true; } } void StoryModeController::rotateYaw(const Vector2& value){ orxout(internal_error) << "RightLeft" << endl; } void StoryModeController::rotatePitch(const Vector2& value){ orxout(internal_error) << "RightLeft" << endl; } void StoryModeController::rotateRoll(const Vector2& value){ orxout(internal_error) << "RightLeft" << endl; } void StoryModeController::fire(unsigned int a){} void StoryModeController::fired(unsigned int b){} void StoryModeController::boost(bool bBoost){ orxout(internal_error) << "Boost" << endl; boostPressed_ = true; } }