Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10718 in orxonox.OLD for branches/presentation/src/world_entities


Ignore:
Timestamp:
Jun 18, 2007, 5:06:59 PM (18 years ago)
Author:
rennerc
Message:

dead gui :D

Location:
branches/presentation/src/world_entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r10714 r10718  
    4242#include "shared_network_data.h"
    4343
     44#include "event_handler.h"
     45
     46#include "story_entity.h"
    4447
    4548
     
    126129  registerEvent(KeyMapper::PEV_FIRE1);
    127130  registerEvent(EV_MOUSE_MOTION);
     131 
     132  this->deadBox = NULL;
    128133
    129134  // weapon manager for the fps
     
    276281void FPSPlayer::tick (float time)
    277282{
    278      // Second init-step
     283  if ( deadBox != NULL )
     284  {
     285    OrxGui::GLGuiHandler::getInstance()->tick( time );
     286  }
     287     
     288  // Second init-step
    279289  if ( !this->initWeapon )
    280290  {
     
    587597{
    588598  Playable::destroy( killer );
    589 
     599  this->showDeadScreen();
     600  myList = this->getOMListNumber();
    590601  toList( OM_DEAD );
    591602}
     
    595606        State::getPlayer()->hud().notifyUser(message);
    596607}
     608
     609void FPSPlayer::onButtonContinue( )
     610{
     611  OrxGui::GLGuiHandler::getInstance()->deactivateCursor( true );
     612  EventHandler::getInstance()->popState();
     613  WorldEntity::reset();
     614  toList( myList );
     615  deadBox->hideAll();
     616}
     617
     618void FPSPlayer::onButtonExit( )
     619{
     620  State::getCurrentStoryEntity()->setNextStoryID( 0 );
     621  State::getCurrentStoryEntity()->stop();
     622}
     623
     624void FPSPlayer::showDeadScreen( )
     625{
     626  EventHandler::getInstance()->pushState( ES_MENU );
     627
     628  OrxGui::GLGuiHandler::getInstance()->activateCursor();
     629 
     630  if ( deadBox )
     631    delete deadBox;
     632  deadBox = new OrxGui::GLGuiBox();
     633  deadBox->setAbsCoor2D( 100, 100 );
     634
     635  OrxGui::GLGuiText* text = new OrxGui::GLGuiText();
     636  text->setText( "Game Over! - You died!" );
     637  OrxGui::GLGuiPushButton* exitButton = new OrxGui::GLGuiPushButton( "exit" );
     638  exitButton->released.connect(this, &FPSPlayer::onButtonExit);
     639  OrxGui::GLGuiPushButton* continueButton = new OrxGui::GLGuiPushButton( "continue" );
     640  continueButton->released.connect(this, &FPSPlayer::onButtonContinue);
     641
     642  deadBox->pack( text );
     643  deadBox->pack( continueButton );
     644  deadBox->pack( exitButton );
     645
     646  deadBox->showAll();
     647}
  • branches/presentation/src/world_entities/creatures/fps_player.h

    r10705 r10718  
    99
    1010#include "playable.h"
     11#include "glgui.h"
    1112
    1213
     
    7677    FPSSniperRifle*       weapon;
    7778   
     79    OM_LIST myList;
     80    OrxGui::GLGuiBox* deadBox;
     81    void onButtonContinue();
     82    void onButtonExit();
     83    void showDeadScreen();
     84   
    7885};
    7986
  • branches/presentation/src/world_entities/npcs/adm_turret.cc

    r10708 r10718  
    174174      dv2.normalize();
    175175      float angle = dv1.dot(dv2);
    176       if (angle > 0.999)
     176      if ( angle > 0.999 && this->myTarget->getOMListNumber()!=OM_DEAD )
    177177      {
    178178        if (this->weapon) this->weapon->fire(true);
  • branches/presentation/src/world_entities/weapons/aiming_system.cc

    r10698 r10718  
    100100  }
    101101
    102   PRINTF(0)("entity: %s\n", nearestEntity->getClassCName());
    103     return nearestEntity;
     102  return nearestEntity;
    104103}
    105104
  • branches/presentation/src/world_entities/weapons/bsp_weapon.cc

    r10713 r10718  
    170170  if ( shortestDist < (pos - target->getAbsCoor()).len() )
    171171  {
     172
     173#ifdef DEBUG_AIMING
    172174    printf("HIT WALL\n");
    173 #ifdef DEBUG_AIMING
    174175    this->debugDist = shortestDist;
    175176#endif
     
    190191    if (r < p )
    191192    {
     193#ifdef DEBUG_AIMING
    192194      printf( "HIT %s\n", target->getClassName().c_str() );
     195#endif
    193196      target->hit( this->damage, this );
    194197    }
     198#ifdef DEBUG_AIMING
    195199    else
    196200      printf( "MISHIT %s\n", target->getClassName().c_str() );
     201#endif
    197202
    198203  }
    199204  else
    200205  {
     206#ifdef DEBUG_AIMING
    201207    printf( "HIT %s\n", target->getClassName().c_str() );
     208#endif
    202209    target->hit( this->damage, this );
    203210  }
     
    217224    (*it)->draw();
    218225  }
    219 #if 1
     226#ifdef DEBUG_AIMING
    220227  glMatrixMode(GL_MODELVIEW);
    221228  glPushMatrix();
     
    231238  Vector mp = this->getAbsCoor();
    232239  Vector op = this->getAbsDir().apply( Vector(1, 0, 0) );
    233 #ifdef DEBUG_AIMING
     240
    234241  op *= debugDist;
    235 #else
    236   op *= 1000;
    237 #endif
    238242  op += mp;
    239243
  • branches/presentation/src/world_entities/weapons/fps_sniper_rifle.cc

    r10711 r10718  
    154154void FPSSniperRifle::fire()
    155155{
    156   PRINTF(0)("sniper fire\n");
    157156  this->bFire = true;
    158157}
     
    193192  this->weapon->fire( bFire );
    194193 
    195   if ( bFire ){
    196       PRINTF(0)("REAL FIRE\n");
    197   }
    198194  bFire = false;
    199195}
  • branches/presentation/src/world_entities/world_entity.cc

    r10714 r10718  
    990990void WorldEntity::hit(float damage, WorldEntity* killer)
    991991{
    992   PRINTF(0)("TESTS: %i %i %i\n", (forwardDamageToParent), (this->getParent() != NullParent::getNullParent()), (this->getParent()->isA( WorldEntity::staticClassID() )));
    993992  if ( forwardDamageToParent && this->getParent() != NullParent::getNullParent() && this->getParent()->isA( WorldEntity::staticClassID() ) )
    994993  {
     
    10041003 
    10051004  this->decreaseHealth(damage);
    1006 
    1007   PRINTF(0)("Hit me: %s::%s now only %f/%f health\n", this->getClassCName(), this->getCName(), this->getHealth(), this->getHealthMax());
    10081005
    10091006  if( this->getHealth() > 0)
Note: See TracChangeset for help on using the changeset viewer.