Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyTower.cc @ 12149

Last change on this file since 12149 was 12086, checked in by sastocke, 5 years ago

switching towers

File size: 3.9 KB
Line 
1//
2//  TixyTaxyTorxyTower.cc
3//  Orxonox
4//
5//  Created by Fabian Mentzer on 29.04.12.
6//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7//
8
9/* Not implemented fully */
10
11#include "TixyTaxyTorxy.h"
12#include "core/CoreIncludes.h"
13//#include "core/XMLPort.h"
14
15namespace orxonox
16{
17    RegisterClass(TixyTaxyTorxyTower);
18
19    /**
20    @brief
21        Constructor. Registers and initializes the object.
22    */
23    TixyTaxyTorxyTower::TixyTaxyTorxyTower(Context* context) : Turret(context)
24    {   
25        RegisterObject(TixyTaxyTorxyTower);
26        game_ =nullptr;
27        this->setCollisionType(WorldEntity::CollisionType::None);
28        upgrade = 1;
29           
30        }
31        //this->removeAllEngines();
32
33        /*
34        this->size_ = 10.0f;
35        this->delay_ = false;
36        this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
37        */
38   
39
40    /*
41    void TixyTaxyTorxy
42TixyTaxyTorxyTower::setOrientation(const Quaternion& orientation)
43    {
44    }
45
46    void TixyTaxyTorxy
47TixyTaxyTorxyTower::rotateYaw(const Vector2& value)
48    {
49    }
50
51    void TixyTaxyTorxy
52TixyTaxyTorxyTower::rotatePitch(const Vector2& value)
53    {
54    }
55
56    void TixyTaxyTorxy
57TixyTaxyTorxyTower::rotateRoll(const Vector2& value)
58    {
59    }
60    */
61
62    bool TixyTaxyTorxyTower::upgradeTower()
63    {
64        if(upgrade < 5)
65        {
66            upgrade++;
67            this->setDamageMultiplier((upgrade+1)*2.0f);
68
69            //this->setRotationThrust(2*this->getRotationThrust());
70            //this->addTemplate("towerturret1");
71        }
72        else
73        {
74            orxout() << "Tower fully upgraded" << endl;
75            return false;
76        }
77        return true;
78    }
79
80    // This function is called whenever a player presses the up or the down key.
81    // You have to implement what happens when the up or the down key is pressed.
82    // value.x < 0 means: down key is pressed.
83    // I suggest to create a new class which is a controllable entity I will refer to as "TixyTaxyTorxy". This is the controllable entity that the
84    // player controls in order to move the TixyTaxyTorxy
85//TixyTaxyTorxyTower along the centerpoint and in order to place the TixyTaxyTorxy
86//TixyTaxyTorxyTower at the appropriate position.
87    //
88
89    // The TixyTaxyTorxy
90//TixyTaxyTorxyTower itsself is controlled by a WayPointPatroController at the instance you place it on the centerpoint.
91    //(don't forget to set the team_ parameter such that all TixyTaxyTorxy
92//TixyTaxyTorxyTower are in the same team)
93
94    //How to move a TixyTaxyTorxy
95//TixyTaxyTorxyTower: simply attach the TixyTaxyTorxy
96//TixyTaxyTorxyTower to the TixyTaxyTorxy
97//TixyTaxyTorxyTowerMover
98    //How to place a TixyTaxyTorxy
99//TixyTaxyTorxyTower: detach the TixyTaxyTorxy
100//TixyTaxyTorxyTower from the TixyTaxyTorxy
101//TixyTaxyTorxyTowerMover
102
103    /**
104    @brief
105        Overloaded the function to rotate the stone.
106    @param value
107        A vector whose first component is the angle by which to rotate.
108    */
109    /*
110    void TixyTaxyTorxy
111TixyTaxyTorxyTower::moveFrontBack(const Vector2& value)
112    {
113        //orxout() << "frontBack.x: " << value.x << endl;
114    }
115    */
116
117    /**
118    @brief
119        Overloaded the function to steer the stone right and left
120    @param value
121        A vector whose first component is the direction in which we want to steer the stone.
122    */
123    /*
124    void TixyTaxyTorxy
125TixyTaxyTorxyTower::moveRightLeft(const Vector2& value)
126    {
127        //orxout() << "rightLeft.x: " << value.x << endl;
128
129        if(!this->delay_)
130        {
131            const Vector3& position = this->getPosition();
132            Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
133            if(!this->tetris_->isValidMove(this, newPos))
134                return;
135
136            this->setPosition(newPos);
137            this->delay_ = true;
138            this->delayTimer_.startTimer();
139        }
140    }
141    */
142}
Note: See TracBrowser for help on using the repository browser.