Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 19, 2007, 11:45:56 AM (17 years ago)
Author:
snellen
Message:

Got nothing to do during the MTU lecture… so I finished the ActionTrigger

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc

    r10632 r10634  
    1717#include "action_trigger.h"
    1818#include "debug.h"
     19#include "event_handler.h"
    1920
    2021ObjectListDefinition(ActionTrigger);
     
    4849{
    4950  this->registerObject(this, ActionTrigger::_objectList);
     51  this->subscribeEvent(ES_GAME, KeyMapper::PEV_ACTION);
    5052
    5153  radius = 10;
     
    117119}
    118120
     121void ActionTrigger::process( const Event &event)
     122{
     123 if (event.type == KeyMapper::PEV_ACTION && event.bPressed)
     124  actionScheduled = true;
     125}
    119126
    120127void ActionTrigger::tick( float timestep )
     
    128135      executeScriptFunction(timestep);
    129136      scriptCalled = true;
    130       return;
    131137    }
    132138    else if( invert && this->distance(target) > radius  && actionScheduled)
     
    134140      executeScriptFunction(timestep);
    135141      scriptCalled = true;
    136       return;
    137142    }
    138143  }
Note: See TracChangeset for help on using the changeset viewer.