Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7865


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
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/trunk/data/levels/pong.oxw

    r7863 r7865  
     1<LevelInfo
     2 name = "Pong"
     3 description = "Pong in space!"
     4 tags = ""
     5/>
     6
    17<?lua
    28  include("HUDTemplates3.oxo")
     
    5258
    5359  <WorldAmbientSound source="mainmenu.ogg" playOnLoad=true />
     60
     61  <PongBot />
    5462
    5563  <Scene
  • 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.