Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 19, 2011, 11:02:56 PM (14 years ago)
Author:
jo
Message:

Finished Polishing Pong. (gametype ends properly now, points necessary to win are configurable)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamecontent/src/modules/pong/Pong.cc

    r8895 r8900  
    3737#include "core/EventIncludes.h"
    3838#include "core/command/Executor.h"
     39#include "core/ConfigValueIncludes.h"
    3940
    4041#include "gamestates/GSLevel.h"
     
    7576        // Set the type of Bots for this particular Gametype.
    7677        this->botclass_ = Class(PongBot);
    77         this->scoreLimit_ = 3; //TODO: 21
     78        this->scoreLimit_ = 10;
     79        this->setConfigValues();
    7880    }
    7981
     
    291293            std::string message(name1 + " has won!");
    292294            ChatManager::message(message);
     295this->tick(0);
    293296            this->end();
    294297        }
     
    298301             std::string message2(name2 + " has won!");
    299302             ChatManager::message(message2);
     303this->tick(0);
    300304             this->end();
    301305        }
     
    342346            return 0;
    343347    }
     348
     349    /**
     350     @brief
     351         Make scoreLimit_ configurable e.g. in the menu.
     352     */
     353    void Pong::setConfigValues()
     354    {
     355        SetConfigValue(scoreLimit_, 10).description("The player first reaching those points wins.");
     356    }
    344357}
Note: See TracChangeset for help on using the changeset viewer.