Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7865 for code/trunk/src


Ignore:
Timestamp:
Feb 12, 2011, 3:08:59 PM (13 years ago)
Author:
landauf
Message:

renamed pong level, added a bot, and changed the pong gametype to spawn human players before bots (player will always get the left bat in singleplayer)

Location:
code/trunk/src/modules/pong
Files:
2 edited

Legend:

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

    r7284 r7865  
    132132    }
    133133
     134    void Pong::spawnPlayersIfRequested()
     135    {
     136        // first spawn human players to assign always the left bat to the player in singleplayer
     137        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     138            if (it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
     139                this->spawnPlayer(it->first);
     140        // now spawn bots
     141        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     142            if (!it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
     143                this->spawnPlayer(it->first);
     144    }
     145
    134146    void Pong::spawnPlayer(PlayerInfo* player)
    135147    {
  • code/trunk/src/modules/pong/Pong.h

    r7852 r7865  
    5757
    5858        protected:
     59            virtual void spawnPlayersIfRequested();
     60
    5961            void startBall();
    6062
Note: See TracChangeset for help on using the changeset viewer.