From 0537af1078e9ab72e60817ffa06aef2e18826fad Mon Sep 17 00:00:00 2001 From: Thad Ward Date: Wed, 27 Aug 2003 12:29:32 +0000 Subject: [PATCH] fix up timing in the BeginnerHelper. (I hate having "magic" numbers, but there are some here that I can't figure out.) --- stepmania/src/BeginnerHelper.cpp | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/stepmania/src/BeginnerHelper.cpp b/stepmania/src/BeginnerHelper.cpp index aa6ef1be38..b52564a541 100644 --- a/stepmania/src/BeginnerHelper.cpp +++ b/stepmania/src/BeginnerHelper.cpp @@ -30,7 +30,6 @@ BeginnerHelper::BeginnerHelper() m_bFlashEnabled = false; m_bInitialized = false; this->AddChild(&m_sBackground); - this->AddChild(&m_sFlash); } BeginnerHelper::~BeginnerHelper() @@ -100,7 +99,6 @@ void BeginnerHelper::Initialize( int iDancePadType, NoteData *pNotes ) case 1:m_mDancePad.LoadMilkshapeAscii( "Characters" SLASH "DancePad-DDR.txt" ); break; case 2:m_mDancePad.LoadMilkshapeAscii( "Characters" SLASH "DancePads-DDR.txt" ); break; } - this->AddChild( &m_mDancePad ); for( int pl=0; plAddChild( &m_mDancer[pl] ); } } @@ -144,7 +140,7 @@ void BeginnerHelper::FlashOnce() m_sFlash.SetDiffuseAlpha(1); m_sFlash.SetEffectNone(); m_sFlash.StopTweening(); - m_sFlash.BeginTweening((GAMESTATE->m_fCurBPS/4)); + m_sFlash.BeginTweening( 1/GAMESTATE->m_fCurBPS * 0.5); m_sFlash.SetDiffuseAlpha(0); } @@ -153,7 +149,8 @@ void BeginnerHelper::DrawPrimitives() if(!m_bInitialized) return; - m_sBackground.Draw(); + ActorFrame::DrawPrimitives(); + m_sFlash.Draw(); DISPLAY->SetLighting( true ); @@ -191,7 +188,7 @@ void BeginnerHelper::Step( int CSTEP ) { case ST_LEFT: m_mDancer[p].PlayAnimation( "Step-LEFT" ); break; case ST_RIGHT: m_mDancer[p].PlayAnimation( "Step-RIGHT" ); break; - case ST_UP: m_mDancer[p].PlayAnimation( "Step-UP" ); break; + case ST_UP: m_mDancer[p].PlayAnimation( "Step-UP" ); break; case ST_DOWN: m_mDancer[p].PlayAnimation( "Step-DOWN" ); break; case ST_JUMPLR: m_mDancer[p].PlayAnimation( "Step-JUMPLR" ); break; case ST_JUMPUD: @@ -199,10 +196,10 @@ void BeginnerHelper::Step( int CSTEP ) m_mDancer[p].PlayAnimation( "Step-JUMPLR" ); m_mDancer[p].StopTweening(); - m_mDancer[p].BeginTweening( GAMESTATE->m_fCurBPS/8, TWEEN_LINEAR ); + m_mDancer[p].BeginTweening( GAMESTATE->m_fCurBPS /8, TWEEN_LINEAR ); m_mDancer[p].SetRotationY( 90 ); - m_mDancer[p].BeginTweening( GAMESTATE->m_fCurBPS/2 ); //sleep between jump-frames - m_mDancer[p].BeginTweening( GAMESTATE->m_fCurBPS/6, TWEEN_LINEAR ); + m_mDancer[p].BeginTweening( (1/GAMESTATE->m_fCurBPS) ); //sleep between jump-frames + m_mDancer[p].BeginTweening( GAMESTATE->m_fCurBPS /6, TWEEN_LINEAR ); m_mDancer[p].SetRotationY( 0 ); break; } @@ -217,20 +214,13 @@ void BeginnerHelper::Update( float fDeltaTime ) float beat = fDeltaTime * GAMESTATE->m_fCurBPS; - m_sFlash.Update( beat ); - for( int scu=0; scum_fSongBeat+0.1f)) ) ) ) + if( (m_NoteData.IsThereATapAtRow( BeatToNoteRowNotRounded((GAMESTATE->m_fSongBeat+0.01f)) ) ) ) FlashOnce(); - if((m_NoteData.IsThereATapAtRow( BeatToNoteRowNotRounded((GAMESTATE->m_fSongBeat+0.45f))))) + if((m_NoteData.IsThereATapAtRow( BeatToNoteRowNotRounded((GAMESTATE->m_fSongBeat+0.5f))))) { for( int k=0; km_fSongBeat+0.45f)) ) == TAP_TAP ) + if( m_NoteData.GetTapNote(k, BeatToNoteRowNotRounded((GAMESTATE->m_fSongBeat+0.5f)) ) == TAP_TAP ) { switch(k) { @@ -242,4 +232,14 @@ void BeginnerHelper::Update( float fDeltaTime ) } Step( iStep ); } + + ActorFrame::Update( fDeltaTime ); + m_mDancePad.Update( fDeltaTime ); + + m_sFlash.Update( fDeltaTime ); + for( int scu=0; scu