Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7044 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Feb 6, 2006, 2:09:01 AM (19 years ago)
Author:
patrick
Message:

trunk: death screen now works

Location:
trunk/src/util
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/game_rules.h

    r7035 r7044  
    2626
    2727
    28     virtual void onPlayerSpawn(Player* player) {}
    29     virtual void onPlayerDeath(Player* player) {}
     28    virtual void onPlayerSpawn() {}
     29    virtual void onPlayerDeath() {}
    3030
    3131
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7040 r7044  
    2323#include "state.h"
    2424
     25#include "player.h"
     26#include "playable.h"
     27
    2528
    2629using namespace std;
     
    4245
    4346  this->deathScreen = new Billboard();
    44   this->deathScreen->setSize(State::getResX(), State::getResY());
     47  this->deathScreen->setSize(State::getResX()/4.0, State::getResY()/4.0);
    4548  this->deathScreen->setAbsCoor2D(State::getResX()/2.0f, State::getResY()/2.0f);
    46   //this->deathScreen->setVisibility(false);
     49  this->deathScreen->setVisibility(false);
     50
     51  this->localPlayer = State::getPlayer();
    4752
    4853  if( root != NULL)
     
    5459 */
    5560MultiplayerTeamDeathmatch::~MultiplayerTeamDeathmatch()
    56 {}
     61{
     62  if( this->deathScreen)
     63    delete this->deathScreen;
     64}
    5765
    5866
     
    8795 * @param player the spawned player
    8896 */
    89 void MultiplayerTeamDeathmatch::onPlayerSpawn(Player* player)
     97void MultiplayerTeamDeathmatch::onPlayerSpawn()
    9098{
    91   this->bLocalPlayerDead = true;
     99  this->bLocalPlayerDead = false;
     100  this->deathScreen->setVisibility(false);
    92101}
    93102
     
    97106 * @param player the killed player
    98107 */
    99 void MultiplayerTeamDeathmatch::onPlayerDeath(Player* player)
     108void MultiplayerTeamDeathmatch::onPlayerDeath()
    100109{
    101   this->localPlayer = player;
    102110  this->bLocalPlayerDead = true;
     111  this->deathScreen->setVisibility(true);
    103112}
    104113
     
    118127
    119128    // long enough dead?
    120     if( dt >= this->deathTimeout)
     129    if( this->timeout >= this->deathTimeout)
    121130    {
    122131      this->timeout = 0.0f;
    123 
    124132      // respawn
     133      (State::getPlayer())->getPlayable()->respawn();
    125134    }
    126135  }
  • trunk/src/util/multiplayer_team_deathmatch.h

    r7039 r7044  
    2929
    3030
    31     virtual void onPlayerSpawn(Player* player);
    32     virtual void onPlayerDeath(Player* player);
     31    virtual void onPlayerSpawn();
     32    virtual void onPlayerDeath();
    3333
    3434
Note: See TracChangeset for help on using the changeset viewer.