Added: Beatmania style arrow-block thingies that appear when you press a key

More Pop'n Noteskin Fun.
This commit is contained in:
Andrew Livy
2003-10-09 03:50:44 +00:00
parent caf7b7f205
commit f69d0db080
6 changed files with 40 additions and 3 deletions
+1
View File
@@ -819,6 +819,7 @@ StyleIcon=1
NextScreen=ScreenGameplay NextScreen=ScreenGameplay
[ScreenGameplay] [ScreenGameplay]
PressBlockY=10
StaticBGY=240 StaticBGY=240
StaticBGX=320 StaticBGX=320
PrevScreenArcade=ScreenSelectMusic PrevScreenArcade=ScreenSelectMusic
+16 -2
View File
@@ -29,7 +29,7 @@ GrayArrow::GrayArrow()
{ {
GR_STEP_SECONDS.Refresh(); GR_STEP_SECONDS.Refresh();
GR_STEP_ZOOM.Refresh(); GR_STEP_ZOOM.Refresh();
m_bIsPressed = false;
StopAnimating(); StopAnimating();
} }
@@ -47,7 +47,10 @@ bool GrayArrow::Load( CString NoteSkin, PlayerNumber pn, int iColNo )
GetNumStates() != 3 ) GetNumStates() != 3 )
RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() ); RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() );
return ret; sPath = NOTESKIN->GetPathTo( NoteSkin, Button, "KeypressBlock" );
bool ret2 = m_sprPressBlock.Load( sPath );
m_sprPressBlock.SetXY(0, THEME->GetMetricI ("ScreenGameplay","PressBlockY"));
return ret&ret2; // return both loaded or fail
} }
void GrayArrow::Update( float fDeltaTime ) void GrayArrow::Update( float fDeltaTime )
@@ -85,6 +88,17 @@ void GrayArrow::Update( float fDeltaTime )
cur_beat -= flash_offset; cur_beat -= flash_offset;
float fPercentIntoBeat = fmodf(cur_beat, 1); float fPercentIntoBeat = fmodf(cur_beat, 1);
SetState( (fPercentIntoBeat<flash_length)? OnState : OffState ); SetState( (fPercentIntoBeat<flash_length)? OnState : OffState );
m_sprPressBlock.Update(fDeltaTime);
}
void GrayArrow::Draw()
{
Sprite::Draw();
if(m_bIsPressed)
{
m_sprPressBlock.Draw();
m_bIsPressed = false;
}
} }
void GrayArrow::Step() void GrayArrow::Step()
+5
View File
@@ -22,8 +22,13 @@ public:
GrayArrow(); GrayArrow();
bool Load( CString NoteSkin, PlayerNumber pn, int iColNo ); bool Load( CString NoteSkin, PlayerNumber pn, int iColNo );
virtual void Draw();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
void Step(); void Step();
void UpdateBars() { m_bIsPressed = true; };
private:
Sprite m_sprPressBlock;
bool m_bIsPressed;
}; };
#endif #endif
+6
View File
@@ -146,6 +146,12 @@ void NoteFieldPlus::Step( int iCol )
m_GrayArrow[iCol].Step(); m_GrayArrow[iCol].Step();
} }
void NoteFieldPlus::UpdateBars( int iCol )
{
ASSERT( iCol >= 0 && iCol < m_iNumCols );
m_GrayArrow[iCol].UpdateBars();
}
void NoteFieldPlus::TapNote( int iCol, TapNoteScore score, bool bBright ) void NoteFieldPlus::TapNote( int iCol, TapNoteScore score, bool bBright )
{ {
ASSERT( iCol >= 0 && iCol < m_iNumCols ); ASSERT( iCol >= 0 && iCol < m_iNumCols );
+2 -1
View File
@@ -31,7 +31,8 @@ public:
void TapNote( int iCol, TapNoteScore score, bool bBright ); void TapNote( int iCol, TapNoteScore score, bool bBright );
void TapMine( int iCol, TapNoteScore score ); void TapMine( int iCol, TapNoteScore score );
void HoldNote( int iCol ); void HoldNote( int iCol );
void UpdateBars( int iCol );
int GetNumCols() { return m_iNumCols; };
protected: protected:
int m_iNumCols; int m_iNumCols;
+10
View File
@@ -230,6 +230,15 @@ void PlayerMinus::Update( float fDeltaTime )
// //
UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() ); UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() );
for(int bar=0; bar < m_pNoteField->GetNumCols(); bar++)
{
const StyleInput StyleI( m_PlayerNumber, bar );
const GameInput GameI = GAMESTATE->GetCurrentStyleDef()->StyleInputToGameInput( StyleI );
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
if(bIsHoldingButton)
m_pNoteField->UpdateBars(bar);
}
// //
// update HoldNotes logic // update HoldNotes logic
// //
@@ -651,6 +660,7 @@ void PlayerMinus::Step( int col, RageTimer tm )
if( bGrayArrowStep ) if( bGrayArrowStep )
m_pNoteField->Step( col ); m_pNoteField->Step( col );
} }
void PlayerMinus::HandleAutosync(float fNoteOffset) void PlayerMinus::HandleAutosync(float fNoteOffset)