Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hoverHS15/src/modules/hover/Hover.cc @ 10819

Last change on this file since 10819 was 10787, checked in by meierman, 10 years ago

programm wall placement works

File size: 3.0 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Florian Zinggeler
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file Hover.cc
31    @brief Implementation of the Hover class.
32*/
33
34//#include "orxonox/worldentities/pawns/SpaceShip.h"
35#include "Hover.h"
36
37#include "HoverWall.h"
38#include "core/CoreIncludes.h"
39
40namespace orxonox
41{
42    bool firstTick = true;
43    int levelcode[10][10] =
44        {
45        { 0,0,0,0,0,0,0,0,0,0 }, // row 0
46        { 1,0,0,0,0,0,0,0,0,0 }, // row 0
47        { 1,0,0,0,0,0,0,0,0,0 }, // row 0
48        { 1,1,3,0,1,3,0,0,0,0 }, // row 0
49        { 1,0,3,2,3,2,0,0,0,0 }, // row 0
50        { 1,0,1,0,1,0,0,0,0,0 }, // row 0
51        { 1,2,2,0,0,0,0,0,0,0 }, // row 0
52        { 1,0,0,0,0,0,0,0,0,0 },  // row 0
53        { 1,0,0,0,0,0,0,0,1,0 },// row 1
54        { 1,0,0,0,0,0,0,1,2,0 } // row 2
55        };
56
57
58    RegisterUnloadableClass(Hover);
59
60    Hover::Hover(Context* context) : Gametype(context)
61    {
62       
63        RegisterObject(Hover);
64        //this->setHUDTemplate("HoverHUD");
65    }
66
67
68
69    void Hover::tick(float dt)
70    {
71        SUPER(Hover, tick, dt);
72
73
74
75
76        if(firstTick)
77        {
78            firstTick = false;
79
80            for(int y=0; y<10; y++){
81                for(int x=0; x<10; x++){
82
83                    switch(levelcode[y][x]){
84                        case 1: new HoverWall(origin_->getContext(), x+1, 10-y, 1);
85                                break;
86                        case 3: new HoverWall(origin_->getContext(), x+1, 10-y, 1);
87                        case 2: new HoverWall(origin_->getContext(), x+1, 10-y, 0);
88                        default: break;
89                    }
90
91
92                   
93                }   
94            }
95
96
97           
98            //new HoverWall(origin_->getContext(), 1, 1, 1);
99            //new HoverWall(origin_->getContext(), 1, 1, 0);
100        }     
101
102
103    }
104
105   
106
107    void Hover::start()
108    {
109
110        // Call start for the parent class.
111        Gametype::start();
112
113    }
114
115
116    void Hover::end()
117    {
118        // DON'T CALL THIS!
119        //      Deathmatch::end();
120        // It will misteriously crash the game!
121        // Instead startMainMenu, this won't crash.
122        GSLevel::startMainMenu();
123    }
124}
Note: See TracBrowser for help on using the repository browser.