Ok, I have this simple routine to shoot bullets, activated by the 'w' key.
Code: Select all
if ( receiver.Keys[ KEY_KEY_W ] ){
IAnimatedMesh* mesh = smgr->getMesh("../../media/bullet1.x");
IAnimatedMeshSceneNode* zap = smgr->addAnimatedMeshSceneNode( mesh );
//set various settings
scene::ISceneNodeAnimator* anim2 = 0;
// set flight line
anim2 = smgr->createFlyStraightAnimator(core::vector3df(boxy_x,boxy_y,boxy_z),core::vector3df(-40,boxy_y,boxy_z), 3000,false);
zap->addAnimator(anim2);
anim2->drop();
}How would I fix this routine so it will only fire once every time the key is pressed down?
I'm almost certain it's an obvious thing, but I can't find it anywhere.