/* * 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: * Florian Zinggeler * Co-authors: * ... * */ /** @file MiniGameTestShip.cc @brief Implementation of the MiniGameTestShip class. */ #include "MiniGameTestShip.h" #include "core/CoreIncludes.h" namespace orxonox { RegisterClass(MiniGameTestShip); MiniGameTestShip::MiniGameTestShip(Context* context) : SpaceShip(context) { RegisterObject(MiniGameTestShip); speed = 830; isFireing = false; damping = 10; // not sure if has to be zero? lastTimeFront = 0; lastTimeLeft = 0; lastTime = 0; } void MiniGameTestShip::tick(float dt) { SUPER(MiniGameTestShip, tick, dt); } void MiniGameTestShip::updateLevel() { lastTime = 0; if (getGame()) getGame()->levelUp(); } /* void MiniGameTestShip::moveFrontBack(const Vector2& value) { //lastTimeFront = 0; //desiredVelocity.y = value.y * speed * 42; orxout() << "FrontBack" << endl; SUPER(MiniGameTestShip, moveFrontBack, value); } void MiniGameTestShip::moveRightLeft(const Vector2& value) { //lastTimeLeft = 0; //desiredVelocity.x = value.x * speed; orxout() << "RightLeft" << endl; SUPER(MiniGameTestShip, moveFrontBack, value); } */ void MiniGameTestShip::boost(bool bBoost) { //getGame()->bEndGame = bBoost; } inline bool MiniGameTestShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) { removeHealth(100); this->death(); return false; } MiniGameTest* MiniGameTestShip::getGame() { if (game == nullptr) { for (MiniGameTest* race : ObjectList()) { game = race; } } return game; } void MiniGameTestShip::death() { getGame()->costLife(); SpaceShip::death(); } }