play Push and Lift commands on the receptor actors

This commit is contained in:
Chris Danford
2005-04-30 07:48:41 +00:00
parent 01d59d97ce
commit 89be4f4324
3 changed files with 27 additions and 5 deletions
+25 -4
View File
@@ -10,10 +10,14 @@
#include "Game.h" #include "Game.h"
#include "PlayerState.h" #include "PlayerState.h"
// eventually, these will replace the pressblocks
const CString PRESS_COMMAND_NAME = "Press";
const CString LIFT_COMMAND_NAME = "Lift";
ReceptorArrow::ReceptorArrow() ReceptorArrow::ReceptorArrow()
{ {
m_bIsPressed = false; m_bIsPressed = false;
m_bWasPressed = false;
StopAnimating(); StopAnimating();
} }
@@ -54,14 +58,28 @@ void ReceptorArrow::Update( float fDeltaTime )
// update pressblock alignment based on scroll direction // update pressblock alignment based on scroll direction
bool bReverse = m_pPlayerState->m_PlayerOptions.GetReversePercentForColumn(m_iColNo) > 0.5; bool bReverse = m_pPlayerState->m_PlayerOptions.GetReversePercentForColumn(m_iColNo) > 0.5;
m_pPressBlock->SetVertAlign( bReverse ? Actor::align_bottom : Actor::align_top ); m_pPressBlock->SetVertAlign( bReverse ? Actor::align_bottom : Actor::align_top );
m_pReceptorGo->SetHidden( !GAMESTATE->m_bPastHereWeGo );
m_pReceptorWaiting->SetHidden( GAMESTATE->m_bPastHereWeGo );
m_pPressBlock->SetHidden( !m_bIsPressed );
if( m_bWasPressed && !m_bIsPressed )
{
m_pReceptorGo->PlayCommand( LIFT_COMMAND_NAME );
m_pReceptorWaiting->PlayCommand( LIFT_COMMAND_NAME );
}
m_bWasPressed = m_bIsPressed;
m_bIsPressed = false; // it may get turned back on next update
} }
void ReceptorArrow::DrawPrimitives() void ReceptorArrow::DrawPrimitives()
{ {
m_pReceptorGo->SetHidden( !GAMESTATE->m_bPastHereWeGo );
m_pReceptorWaiting->SetHidden( GAMESTATE->m_bPastHereWeGo );
m_pPressBlock->SetHidden( !m_bIsPressed );
m_bIsPressed = false; // it may get turned back on next update
ActorFrame::DrawPrimitives(); ActorFrame::DrawPrimitives();
} }
@@ -72,6 +90,9 @@ void ReceptorArrow::Step( TapNoteScore score )
m_pReceptorWaiting->FinishTweening(); m_pReceptorWaiting->FinishTweening();
m_pReceptorGo->RunCommands( *m_sScoreCommand[score] ); m_pReceptorGo->RunCommands( *m_sScoreCommand[score] );
m_pReceptorWaiting->RunCommands( *m_sScoreCommand[score] ); m_pReceptorWaiting->RunCommands( *m_sScoreCommand[score] );
m_pReceptorGo->PlayCommand( PRESS_COMMAND_NAME );
m_pReceptorWaiting->PlayCommand( PRESS_COMMAND_NAME );
} }
/* /*
+1
View File
@@ -31,6 +31,7 @@ private:
AutoActor m_pPressBlock; AutoActor m_pPressBlock;
bool m_bIsPressed; bool m_bIsPressed;
bool m_bWasPressed; // set in Update
}; };
#endif #endif
+1 -1
View File
@@ -37,7 +37,7 @@ void ReceptorArrowRow::Update( float fDeltaTime )
for( int c=0; c<m_iNumCols; c++ ) for( int c=0; c<m_iNumCols; c++ )
{ {
m_ReceptorArrow[c].Update( fDeltaTime ); m_ReceptorArrow[c].Update( fDeltaTime );
m_ReceptorArrow[c].SetDiffuse( RageColor(1,1,1,1 - m_pPlayerState->m_CurrentPlayerOptions.m_fDark) ); m_ReceptorArrow[c].SetBaseAlpha( 1 - m_pPlayerState->m_CurrentPlayerOptions.m_fDark );
// set arrow XYZ // set arrow XYZ
const float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 ); const float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );