Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 7:28:41 PM (18 years ago)
Author:
patrick
Message:

more aiming system work. nothing visible yet

File:
1 edited

Legend:

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

    r9163 r9166  
    3232
    3333#include "aabb.h"
     34
    3435
    3536#include "key_mapper.h"
     
    9091  this->bJump = false;
    9192  this->bPosBut = false;
     93  this->bFire = false;
    9294
    9395  this->xMouse = 0.0f;
     
    143145  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
    144146
     147  this->aimingSystem = new AimingSystem();
     148  this->addChild(this->aimingSystem);
     149  this->aimingSystem->toList(OM_LIST(this->getOMListNumber() + 1));
     150
    145151
    146152  // network registration
     
    245251
    246252
    247 
    248 
    249   Playable::tick( time );
     253  this->getWeaponManager().tick(time);
     254  if( this->bFire)
     255  {
     256    this->getWeaponManager().fire();
     257
     258    WorldEntity* target = this->aimingSystem->getNearestTarget();
     259    if( target != NULL)
     260    {
     261      PRINTF(0)("hit hit hit, got: %s\n", target->getClassName());
     262    }
     263    else
     264    {
     265      PRINTF(0)("nothing hit\n");
     266    }
     267  }
     268
     269
     270
    250271
    251272  if( ( xMouse != 0 || yMouse != 0 ) && (this->getOwner() == SharedNetworkData::getInstance()->getHostID() || !State::isOnline() ) )
     
    407428  }
    408429  else if( event.type == KeyMapper::PEV_JUMP)
     430  {
    409431    this->bJump = event.bPressed;
     432  }
     433  else if( event.type == KeyMapper::PEV_FIRE1)
     434  {
     435    this->bFire = event.bPressed;
     436  }
    410437}
    411438
     
    420447{
    421448  Playable::destroy( killer );
    422  
     449
    423450  toList( OM_DEAD );
    424451}
Note: See TracChangeset for help on using the changeset viewer.