working on Rave

This commit is contained in:
Chris Danford
2003-06-30 18:08:27 +00:00
parent 740fd31f9e
commit fa91f2e636
44 changed files with 658 additions and 577 deletions
+19 -16
View File
@@ -18,38 +18,41 @@
#include "GameState.h"
#include "ThemeManager.h"
const float LEVEL_WIDTH = 50;
ScoreDisplayRave::ScoreDisplayRave()
{
LOG->Trace( "ScoreDisplayRave::ScoreDisplayRave()" );
m_sprFrame.Load( THEME->GetPathToG("ScoreDisplayRave frame") );
this->AddChild( &m_sprFrame );
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
{
m_LevelStream[i].Load( THEME->GetPathToG(ssprintf("ScoreDisplayRave stream level%d",i+1)), LEVEL_WIDTH );
float fSpan = (NUM_ATTACK_LEVELS-1)*LEVEL_WIDTH;
float fX = SCALE(i,0.f,NUM_ATTACK_LEVELS-1.f, -fSpan/2, fSpan/2 );
m_LevelStream[i].SetX( fX );
this->AddChild( &m_LevelStream[i] );
}
m_textCurrentAttack.LoadFromFont( THEME->GetPathToF("Common normal") );
this->AddChild( &m_textCurrentAttack );
this->AddChild( &m_sprFrame );
}
void ScoreDisplayRave::Init( PlayerNumber pn )
{
ScoreDisplay::Init( pn );
m_sprFrame.Load( THEME->GetPathToG(ssprintf("ScoreDisplayRave frame p%d",pn+1)) );
}
void ScoreDisplayRave::Update( float fDelta )
{
ScoreDisplay::Update( fDelta );
CString sNewAttack = GAMESTATE->m_ActiveAttacks[m_PlayerNumber][0].sModifier;
if( sNewAttack != m_sLastSeenAttack )
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
{
m_textCurrentAttack.SetText( sNewAttack );
m_textCurrentAttack.StopTweening();
m_textCurrentAttack.Command( "diffuse,1,1,1,1;zoom,1;"
"sleep,0.1;linear,0;diffusealpha,0;"
"sleep,0.1;linear,0;diffusealpha,1;"
"sleep,0.1;linear,0;diffusealpha,0;"
"sleep,0.1;linear,0;diffusealpha,1;"
"sleep,0.1;linear,0;diffusealpha,0;"
"sleep,0.1;linear,0;diffusealpha,1;" );
float fLevelPercent = GAMESTATE->m_fSuperMeter[m_PlayerNumber] - i;
CLAMP( fLevelPercent, 0 ,1 );
m_LevelStream[i].SetPercent( fLevelPercent );
}
}