Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12062


Ignore:
Timestamp:
Oct 31, 2018, 10:56:46 AM (5 years ago)
Author:
ottka
Message:

level added

Location:
code/branches/OrxoKart_HS18
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw

    r12057 r12062  
    2626N = 11
    2727--scaling factor
    28 S = 250
     28S = 150
     29-- Map Matrix
     30MAP = "1,0,1,01,10,10,10,10,1,101,1,0101,010,10,10,10,10,10,10,10,1010,10,0,10,10,10,10,00,1,01,0110,11,01,01,10,1,1,1,10,1,10"
    2931
    3032MAP_ORIGIN = "0,0,0"
     
    4951      <attached>
    5052        <!-- Walls and flags (physics and design)-->
    51         <!--
     53        <!-- 
    5254        <HoverOrigin
    53           numCells="<?lua print(MAZE_NUM_CELLS)?>"
    54           cellSize="<?lua print(MAZE_CELL_SIZE)?>"
     55          numCells="<?lua print(N)?>"
     56          cellSize="<?lua print(S)?>"
    5557          cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
    5658        />
     
    5860
    5961        <!-- floor design -->
    60 
    61 
    62 
    63 
    64 
    65 
    6662       
    6763        <Model
  • code/branches/OrxoKart_HS18/src/modules/hover/Hover.cc

    r11495 r12062  
    7070            generator.generateMaze();
    7171            generator.renderMaze();
     72            int levelcodeArray[] = {1,1,1,1,1,1,1,1,0,0,0
     73                                    ,1,0,0,0,0,0,0,1,1,1,0
     74                                    ,1,0,1,1,1,1,0,0,0,1,1
     75                                    ,1,1,1,0,0,1,1,0,0,0,1
     76                                    ,0,0,0,0,0,0,1,0,1,1,1
     77                                    ,1,1,1,1,1,1,1,0,1,0,0
     78                                    ,1,0,0,0,0,0,0,0,1,0,0
     79                                    ,1,0,0,0,0,0,0,0,1,0,0
     80                                    ,1,1,1,1,1,0,0,0,1,1,1
     81                                    ,0,0,0,0,1,0,0,0,0,0,1
     82                                    ,0,0,0,0,1,1,1,1,1,1,1};
     83            //int* levelcode = generator.getLevelcode();
     84            int* levelcode = levelcodeArray;
    7285
    73             int* levelcode = generator.getLevelcode();
    7486
    7587            //Outer Walls
     
    8799                        case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
    88100                                break;
    89                         case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
    90                         case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
     101                        //case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
     102                        //case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
    91103                        default: break;
    92104                    }
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc

    r12057 r12062  
    3535
    3636#include "OrxoKartOrigin.h"
    37 #include "OrxoKartWall.h"
     37#include "OrxoKartTile.h"
    3838#include "core/CoreIncludes.h"
    3939
     
    5050        this->firstTick_ = true;
    5151
    52         this->setHUDTemplate("HoverHUD");
     52        this->nullptr
    5353    }
    5454
    5555    void OrxoKart::tick(float dt)
    56     { /*
     56    {
    5757        SUPER(OrxoKart, tick, dt);
    5858
     
    6868            generator.generateMaze();
    6969            generator.renderMaze();
    70 
    71             int* levelcode = generator.getLevelcode();
     70            int levelcodeArray[] = {1,1,1,1,1,1,1,1,0,0,0
     71                                    ,1,0,0,0,0,0,0,1,1,1,0
     72                                    ,1,0,1,1,1,1,0,0,0,1,1
     73                                    ,1,1,1,0,0,1,1,0,0,0,1
     74                                    ,0,0,0,0,0,0,1,0,1,1,1
     75                                    ,1,1,1,1,1,1,1,0,1,0,0
     76                                    ,1,0,0,0,0,0,0,0,1,0,0
     77                                    ,1,0,0,0,0,0,0,0,1,0,0
     78                                    ,1,1,1,1,1,0,0,0,1,1,1
     79                                    ,0,0,0,0,1,0,0,0,0,0,1
     80                                    ,0,0,0,0,1,1,1,1,1,1,1};
     81            //int* levelcode = generator.getLevelcode();
     82            int* levelcode = levelcodeArray;
    7283
    7384            //Outer Walls
    7485            for(int i = 0; i<numCells; i++){
    75                 (new HoverWall(origin_->getContext()))->init(0,        i+1,      cellSize, cellHeight, 1);
    76                 (new HoverWall(origin_->getContext()))->init(numCells, i+1,      cellSize, cellHeight, 1);
    77                 (new HoverWall(origin_->getContext()))->init(i+1,      0,        cellSize, cellHeight, 2);
    78                 (new HoverWall(origin_->getContext()))->init(i+1,      numCells, cellSize, cellHeight, 2);
     86                (new OrxoKartTile(origin_->getContext()))->init(0,        i+1,      cellSize, cellHeight, 1);
     87                (new OrxoKartTile(origin_->getContext()))->init(numCells, i+1,      cellSize, cellHeight, 1);
     88                (new OrxoKartTile(origin_->getContext()))->init(i+1,      0,        cellSize, cellHeight, 2);
     89                (new OrxoKartTile(origin_->getContext()))->init(i+1,      numCells, cellSize, cellHeight, 2);
    7990            }
    8091
     
    8394                for(int x=0; x<numCells; x++){
    8495                    switch(levelcode[ y * numCells + x ]){
    85                         case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
     96                        case 1: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
    8697                                break;
    87                         case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
    88                         case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
     98                        case 3: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
     99                        case 2: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
    89100                        default: break;
    90101                    }
     
    92103            }
    93104
    94             //Generate 5 flags randomly
    95             for ( int i = 0; i < 5; i++ )
    96             {
    97                 HoverFlag* flag = new HoverFlag(origin_->getContext());
    98                 flag->init(rand()%numCells, rand()%numCells, cellSize);
    99                 flags_.push_back(flag);
    100             }
     105           
    101106
    102107        }//firsttick end
     
    110115        }
    111116        numberOfFlags_ = flags_.size();
    112         */
     117       
    113118    }
    114119}
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h

    r12057 r12062  
    5252            virtual void tick(float dt) override;
    5353
    54             void setOrigin(HoverOrigin* origin)
     54            void setOrigin(OrxoKartOrigin* origin)
    5555                { this->origin_ = origin; }
    5656
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc

    r12057 r12062  
    5353        XMLPortParam(OrxoKartOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode);
    5454        XMLPortParam(OrxoKartOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode);
    55         XMLPortParam(OrxoKartOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode);
     55        XMLPortParam(OrxoKartOrigin, "mapMatrix", setMapMatrix, getMapMatrix, xmlelement, mode);
    5656    }
    5757
    58     void HoverOrigin::checkGametype()
     58    void OrxoKartOrigin::checkGametype()
    5959    {
    6060        if (getGametype() != nullptr && this->getGametype()->isA(Class(OrxoKart)))
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h

    r12057 r12062  
    6161                { return this->cellSize_; }
    6262
    63             inline void setCellHeight(int cellHeight)
    64                 { this->cellHeight_ = cellHeight; }
    65             inline int getCellHeight() const
    66                 { return this->cellHeight_; }
     63            inline void setMapMatrix(int mapMatrix)
     64                { this->mapMatrix_ = mapMatrix; }
     65            inline int getMapMatrix() const
     66                { return this->mapMatrix_; }
    6767
    6868        private:
     
    7171            int numCells_;
    7272            int cellSize_;
    73             int cellHeight_;
     73            int mapMatrix_;
    7474    };
    7575}
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc

    r12057 r12062  
    2828
    2929/**
    30     @file HoverWall.cc
    31     @brief Represents one Wall piece in the Hover Game
     30    @file OrxoKartTile.cc
     31    @brief Represents one Wall piece in the OrxoKart Game
    3232*/
    3333
    34 #include "HoverWall.h"
     34#include "OrxoKartTile.h"
    3535
    3636#include "core/CoreIncludes.h"
     
    4040namespace orxonox
    4141{
    42     RegisterClass(HoverWall);
     42    RegisterClass(OrxoKartTile);
    4343
    44     HoverWall::HoverWall(Context* context) : StaticEntity(context)
     44    OrxoKartTile::OrxoKartTile(Context* context) : StaticEntity(context)
    4545    {
    46         RegisterObject(HoverWall);
     46        RegisterObject(OrxoKartTile);
    4747
    4848        this->model_ = nullptr;
     
    5858        Destructor.
    5959    */
    60     HoverWall::~HoverWall()
     60    OrxoKartTile::~OrxoKartTile()
    6161    {
    6262        if (this->isInitialized())
     
    7171    /**
    7272    @brief
    73         Initializes a HoverWall
     73        Initializes a OrxoKartTile
    7474    @param x
    7575        x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
     
    8383            Wall on the right side (1) or on top (2) of this square, 0-1       
    8484    */
    85     void HoverWall::init(int x, int y, int cellSize, int cellHeight, int orientation)
     85    void OrxoKartTile::init(int x, int y, int cellSize, int cellHeight, int orientation)
    8686    {
    8787        int xSize_, zSize_, xPos_, zPos_;
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h

    r12057 r12062  
    2828
    2929/**
    30     @file HoverWall.h
     30    @file OrxoKartTile.h
    3131    @brief See .cc-file for further information
    32     @ingroup Hover
     32    @ingroup OrxoKart
    3333*/
    3434
    35 #ifndef _HoverWall_H__
    36 #define _HoverWall_H__
     35#ifndef _OrxoKartTile_H__
     36#define _OrxoKartTile_H__
    3737
    38 #include "HoverPrereqs.h"
     38#include "OrxoKartPrereqs.h"
    3939#include "objects/ObjectsPrereqs.h"
    4040
     
    4343namespace orxonox
    4444{
    45     class _HoverExport HoverWall : public StaticEntity
     45    class _OrxoKartExport OrxoKartTile : public StaticEntity
    4646    {
    4747        public:
    48             HoverWall(Context* context);
    49             virtual ~HoverWall();
     48            OrxoKartTile(Context* context);
     49            virtual ~OrxoKartTile();
    5050
    5151            void init(int x, int y, int cellSize, int cellHeight, int orientation);
     
    5757}
    5858
    59 #endif /* _HoverWall_H__ */
     59#endif /* _OrxoKartTile_H__ */
Note: See TracChangeset for help on using the changeset viewer.