I'm trying to figure out the best way to timeout the input if too much time passes between key presses. Should I create a cheatTime float that's incremented by delta every call to update? It's late, I'm tired and my brain is fried. Any help would be appreciated. m_pDI
is a DirectInput wrapper object. Inside that class I have a ClearInput()
function which will clear out any input inside its buffer.
if( m_pDI->KeyDown( DIK_TAB ) && m_pDI->KeyDown( DIK_1 ) )
{
if( m_pDI->KeyDown( DIK_H ) )
{
m_bGameCheats[ 0 ] = true;
if( !m_pXA->SFXIsSoundPlaying( m_nCheatSoundID ) )
m_pXA->SFXPlaySound( m_nCheatSoundID, false );
}
else if( m_pDI->KeyDown( DIK_C ) )
{
m_bGameCheats[ 1 ] = true;
if( !m_pXA->SFXIsSoundPlaying( m_nCheatSoundID ) )
m_pXA->SFXPlaySound( m_nCheatSoundID, false );
}
else if( m_pDI->KeyDown( DIK_S ) )
{
m_bGameCheats[ 2 ] = true;
if( !m_pXA->SFXIsSoundPlaying( m_nCheatSoundID ) )
m_pXA->SFXPlaySound( m_nCheatSoundID, false );
}
}