Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10930 for code


Ignore:
Timestamp:
Dec 7, 2015, 2:32:47 PM (9 years ago)
Author:
meierman
Message:

Finished with comments

Location:
code/branches/hoverHS15/src/modules/hover
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hoverHS15/src/modules/hover/Hover.cc

    r10928 r10930  
    2121 *
    2222 *   Author:
    23  *      Florian Zinggeler
     23 *      Manuel Meier
    2424 *   Co-authors:
    25  *      ...
     25 *      Cyrill Muskelprotz
    2626 *
    2727 */
     
    2929/**
    3030    @file Hover.cc
    31     @brief Implementation of the Hover class.
     31    @brief Implementation of the Hover class. Sets up the whole Minigame
    3232*/
    3333
     
    5151{
    5252    bool firstTick = true;
     53
     54    //Levelcode represents the pitch: It's a 10x10 field.
     55    // 1 represents a Wall on the right side of this square
     56    // 2 represents a Wall on the top of this square
     57    // 3 represents 2 and 1 at the same time
     58    // Note: the levelcode is generated from the Maze-Generator functions at the beginning of the game
    5359    int levelcode[10][10] =
    5460        {
     
    122128            g_PtY=0;
    123129            GenerateMaze();
    124             MazeOut();
    125130            RenderMaze();
    126             LevelOut();
    127131            firstTick = false;
    128132
     
    135139            }
    136140
     141            //Generate inner Walls according to levelcode
    137142            for(int y=0; y<10; y++){
    138143                for(int x=0; x<10; x++){
     
    150155            }
    151156
    152 
     157            //Generate 5 flags randomly
    153158            for ( int i = 0; i < 5; i++ )
    154159                flagVector.push_back(new HoverFlag(origin_->getContext(), rand()%10, rand()%10));
    155160
    156161            Flags_ = flagVector.size();
    157            
    158             //new HoverFlag(origin_->getContext()); //Rechts in Y Richtung
    159             //new HoverWall(origin_->getContext(), 5, 6, 0); //Ueber in x richtung
    160             //new HoverWall(origin_->getContext(), 5, 5, 0); //Ueber in x richtung
    161         }
     162
     163        }//firsttick end
     164
     165        // Check if ship collided with one of the flags
    162166        for ( int i = 0; i < flagVector.size(); i++ ){
    163167            if(flagVector[i]->getCollided()){
     
    200204
    201205
    202     ////////////////////////////////////////////////////////////////////////////
    203 
     206    // Some definitions for the Maze-Generator
    204207
    205208    //                   0  1  2  3  4  5  6  7  8
     
    220223
    221224
    222     ////////////////////////////////////////////////////////////////////////////
    223 
     225    /**
     226    @brief
     227        Checks if Direction is valid (for Maze-Generator)
     228    */
    224229    bool Hover::IsDirValid( eDirection Dir )
    225230    {
     
    232237    }
    233238
     239    /**
     240    @brief
     241        Generates new Direction (for Maze-Generator)
     242    */
    234243    eDirection Hover::GetDirection()
    235244    {
     
    259268    }
    260269
     270    /**
     271    @brief
     272        Generates a Maze (for Maze-Generator)
     273    */
    261274    void Hover::GenerateMaze()
    262275    {
     
    265278        for ( eDirection Dir = GetDirection(); Dir != eDirection_Invalid; Dir = GetDirection() )
    266279        {
    267             // a progress indicator, kind of
    268            // if ( ++Cells % 1000 == 0 ) std::cout << ".";
    269 
    270280            g_Maze[ CellIdx() ] |= Dir;
    271281
     
    275285            g_Maze[ CellIdx() ] = Mask[ Dir ];
    276286        }
    277 
    278         std::cout << std::endl;
    279287    } 
    280288   
    281 
     289    /**
     290    @brief
     291        Print Maze (for Debugging only)
     292    */
    282293    void Hover::MazeOut(){
    283294        for ( int y = 0; y < NumCells; y++ )
     
    302313    }
    303314
     315    /**
     316    @brief
     317        Print Levelcode (for Debugging only)
     318    */
    304319    void Hover::LevelOut(){
    305320        for ( int y = 0; y < NumCells; y++ )
     
    307322            for ( int x = 0; x < NumCells; x++ )
    308323            {
    309                 /*orxout()<<"[";
     324                orxout()<<"[";
    310325                if ( levelcode[x][y] < 2) orxout()<<"U";
    311326                else orxout()<<" ";
     
    315330                orxout()<<" ";
    316331                orxout()<<" ";
    317                 orxout()<<"]";*/
    318 
    319                 orxout()<<levelcode[x][y];
     332                orxout()<<"]";
    320333            }
    321334            orxout()<<endl;
    322335        }
    323 
    324 
    325 
    326     }
    327 
     336    }
     337
     338    /**
     339    @brief
     340        Generate Levelcode from Maze
     341    */
    328342    void Hover::RenderMaze()
    329343    {
     
    336350                if ( !( v & eDirection_Up    ) && y >0) levelcode[y][x] |= 2;
    337351                if ( !( v & eDirection_Right ) && x <9) levelcode[y][x] |= 1;
    338                 //if ( !( v & eDirection_Down  ) && y>0) levelcode[x][y-1] += 2;
    339                 //if ( !( v & eDirection_Left  ) && x>0) levelcode[x-1][y] += 1;
    340352            }
    341353        }
  • code/branches/hoverHS15/src/modules/hover/Hover.h

    r10900 r10930  
    2020 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2121 *
    22  *   Author:
    23  *      Florian Zinggeler
     22 *   Master of Desaster:
     23 *      Manuel Meier
    2424 *   Co-authors:
    25  *      ...
     25 *      Cyrill Muskelprotz
    2626 *
    2727 */
     
    2929/**
    3030    @file Hover.h
    31     @brief Gametype.
     31    @brief Gametype. For more information see .cc file
    3232    @ingroup Hover
    3333*/
     
    3737
    3838#include "HoverPrereqs.h"
    39 #include "HoverOrigin.h" // Necessary for WeakPointer
    40 //#include "HoverShip.h"        DO NOT include in Header. Will cause forward declaration issues
    41 
    42 //#include "HoverHUDinfo.h"
     39#include "HoverOrigin.h"
    4340
    4441#include "gametypes/Gametype.h"
     
    8077            virtual void end();
    8178
    82             virtual void tick(float dt);
    83 
    84             // void setOrigin(HoverOrigin* center)
    85             //    { center_ = center; }           
     79            virtual void tick(float dt);         
    8680
    8781            void setOrigin(HoverOrigin* origin)
  • code/branches/hoverHS15/src/modules/hover/HoverFlag.cc

    r10928 r10930  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Manuel Meier
    2424 *   Co-authors:
    2525 *      ...
     
    2929/**
    3030    @file HoverFlag.cc
    31     @brief All platforms in this minigame inherit from this class. The basic functions of a platform (interact with figure) is implemented here. Special functions are implemented in the specialized classes.
     31    @brief The Flags that are being set in the Hover Minigame They support two coordinates from 0-9 each
    3232*/
    3333
     
    5656    }
    5757
     58    /**
     59    @brief
     60        Constructor that expects two coordinate-values in the range 0-9
     61    @param xCoordinate
     62        X-Coordinate of the flage, 0-9, origin is bottom left
     63    @param yCoordinate
     64        Y-Coordinate of the flage, 0-9, origin is bottom left
     65    */
    5866    HoverFlag::HoverFlag(Context* context, int xCoordinate, int yCoordinate) : StaticEntity(context)
    5967    {
     
    92100    }
    93101
    94     //xml port for loading height and width of the platform
     102    //xml port unused
    95103    void HoverFlag::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    96104    {
     
    104112    @brief
    105113        Is called every tick.
    106         Handles the movement of the ball and its interaction with the boundaries and bats.
    107114    @param dt
    108115        The time since the last tick.
     
    114121    }
    115122
     123    /**
     124    @brief
     125        Checks if the Hovership collided with the flag
     126    */
    116127    bool HoverFlag::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    117128    {
  • code/branches/hoverHS15/src/modules/hover/HoverFlag.h

    r10894 r10930  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Manuel Meier
    2424 *   Co-authors:
    2525 *      ...
     
    2929/**
    3030    @file HoverFlag.h
    31     @brief Declaration of the HoverFlag class.
    32     @ingroup Jump
     31    @brief See .cc File
     32    @ingroup Hover
    3333*/
    3434
  • code/branches/hoverHS15/src/modules/hover/HoverOrigin.cc

    r10751 r10930  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Manuel Meier
    2424 *   Co-authors:
    2525 *      ...
  • code/branches/hoverHS15/src/modules/hover/HoverOrigin.h

    r10751 r10930  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Manuel Meier
    2424 *   Co-authors:
    2525 *      ...
  • code/branches/hoverHS15/src/modules/hover/HoverWall.cc

    r10926 r10930  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Manuel Meier
    2424 *   Co-authors:
    2525 *      ...
     
    2929/**
    3030    @file HoverWall.cc
    31     @brief All platforms in this minigame inherit from this class. The basic functions of a platform (interact with figure) is implemented here. Special functions are implemented in the specialized classes.
     31    @brief Represents one Wall piece in the Hover Game
    3232*/
    3333
     
    5454    }
    5555
     56
     57    /**
     58    @brief
     59        Constructor of a HoverWall
     60    @param x
     61        x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
     62    @param y
     63        y-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
     64    @param orientation
     65            Wall on the right side (1) or on top (2) of this square, 0-1       
     66    */
    5667    HoverWall::HoverWall(Context* context, int x, int y, int orientation) : StaticEntity(context)
    5768    {
     
    101112    }
    102113
    103     //xml port for loading height and width of the platform
     114    //xml port for loading height and width of the platform, unused
    104115    void HoverWall::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    105116    {
    106117        SUPER(HoverWall, XMLPort, xmlelement, mode);
    107 
    108        // XMLPortParam(HoverWall, "height", setHeight, getHeight, xmlelement, mode);
    109         //XMLPortParam(HoverWall, "width", setWidth, getWidth, xmlelement, mode);
    110118    }
    111119
  • code/branches/hoverHS15/src/modules/hover/HoverWall.h

    r10785 r10930  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Manuel Meier
    2424 *   Co-authors:
    2525 *      ...
     
    2929/**
    3030    @file HoverWall.h
    31     @brief Declaration of the HoverWall class.
    32     @ingroup Jump
     31    @brief See .cc-file for further information
     32    @ingroup Hover
    3333*/
    3434
Note: See TracChangeset for help on using the changeset viewer.