Added demonstration
This commit is contained in:
@@ -209,7 +209,7 @@ bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations )
|
||||
GetDirListing( RANDOMMOVIES_DIR + "*.avi", asMovieNames );
|
||||
GetDirListing( RANDOMMOVIES_DIR + "*.mpg", asMovieNames );
|
||||
GetDirListing( RANDOMMOVIES_DIR + "*.mpeg", asMovieNames );
|
||||
for( int i=0; i<min(asMovieNames.GetSize(),8); i++ ) // only load up to 8 background because they take a long time to load
|
||||
for( int i=0; i<min(asMovieNames.GetSize(),5); i++ ) // only load up to 5 background because they are slow to load
|
||||
{
|
||||
CString sMovieName = asMovieNames[rand()%asMovieNames.GetSize()];
|
||||
m_BackgroundAnimations.Add( new BackgroundAnimation(RANDOMMOVIES_DIR+sMovieName, NULL) );
|
||||
|
||||
@@ -23,7 +23,6 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our progr
|
||||
|
||||
GameState::GameState()
|
||||
{
|
||||
m_CurGame = GAME_DANCE;
|
||||
m_CurGame = GAME_DANCE;
|
||||
Reset();
|
||||
}
|
||||
@@ -44,6 +43,7 @@ void GameState::Reset()
|
||||
m_SongSortOrder = SORT_GROUP;
|
||||
m_PlayMode = PLAY_MODE_INVALID;
|
||||
m_bEditing = false;
|
||||
m_bDemonstration = false;
|
||||
m_iCurrentStageIndex = 0;
|
||||
|
||||
|
||||
@@ -208,7 +208,9 @@ bool GameState::IsExtraStage2()
|
||||
|
||||
CString GameState::GetStageText()
|
||||
{
|
||||
if( IsFinalStage() )
|
||||
if( m_bDemonstration )
|
||||
return "Demo";
|
||||
else if( IsFinalStage() )
|
||||
return "Final";
|
||||
else if( IsExtraStage() )
|
||||
return "Extra";
|
||||
|
||||
@@ -47,7 +47,8 @@ public:
|
||||
DifficultyClass m_PreferredDifficultyClass[NUM_PLAYERS];
|
||||
SongSortOrder m_SongSortOrder; // used by MusicWheel
|
||||
PlayMode m_PlayMode;
|
||||
bool m_bEditing;
|
||||
bool m_bEditing; // NoteField does special stuff when this is true
|
||||
bool m_bDemonstration; // ScreenGameplay does special stuff when this is true
|
||||
int m_iCurrentStageIndex; // incremented on Eval screen
|
||||
|
||||
int GetStageIndex();
|
||||
|
||||
@@ -567,16 +567,18 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
int i;
|
||||
|
||||
CArray<Course*,Course*> apCourses;
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ONI:
|
||||
for( int i=0; i<SONGMAN->m_aOniCourses.GetSize(); i++ )
|
||||
for( i=0; i<SONGMAN->m_aOniCourses.GetSize(); i++ )
|
||||
apCourses.Add( &SONGMAN->m_aOniCourses[i] );
|
||||
SortCoursePointerArrayByDifficulty( apCourses );
|
||||
break;
|
||||
case PLAY_MODE_ENDLESS:
|
||||
for( int i=0; i<SONGMAN->m_aEndlessCourses.GetSize(); i++ )
|
||||
for( i=0; i<SONGMAN->m_aEndlessCourses.GetSize(); i++ )
|
||||
apCourses.Add( &SONGMAN->m_aEndlessCourses[i] );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -510,12 +510,14 @@ void NoteData::Turn( PlayerOptions::TurnType tt )
|
||||
{
|
||||
int iTakeFromTrack[MAX_NOTE_TRACKS]; // New track "t" will take from old track iTakeFromTrack[t]
|
||||
|
||||
int t;
|
||||
|
||||
switch( tt )
|
||||
{
|
||||
case PlayerOptions::TURN_NONE:
|
||||
return; // nothing to do
|
||||
case PlayerOptions::TURN_MIRROR:
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
for( t=0; t<m_iNumTracks; t++ )
|
||||
iTakeFromTrack[t] = m_iNumTracks-t-1;
|
||||
break;
|
||||
case PlayerOptions::TURN_LEFT:
|
||||
@@ -581,10 +583,10 @@ void NoteData::Turn( PlayerOptions::TurnType tt )
|
||||
break;
|
||||
case PlayerOptions::TURN_SHUFFLE:
|
||||
CArray<int,int> aiTracksLeftToMap;
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
for( t=0; t<m_iNumTracks; t++ )
|
||||
aiTracksLeftToMap.Add( t );
|
||||
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
for( t=0; t<m_iNumTracks; t++ )
|
||||
{
|
||||
int iRandTrackIndex = rand()%aiTracksLeftToMap.GetSize();
|
||||
int iRandTrack = aiTracksLeftToMap[iRandTrackIndex];
|
||||
@@ -600,7 +602,7 @@ void NoteData::Turn( PlayerOptions::TurnType tt )
|
||||
this->ConvertHoldNotesTo2sAnd3s();
|
||||
|
||||
// transform notes
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
for( t=0; t<m_iNumTracks; t++ )
|
||||
for( int r=0; r<MAX_TAP_NOTE_ROWS; r++ )
|
||||
tempNoteData.m_TapNotes[t][r] = m_TapNotes[iTakeFromTrack[t]][r];
|
||||
|
||||
|
||||
@@ -140,8 +140,9 @@ void Player::Update( float fDeltaTime )
|
||||
//
|
||||
// Check for TapNote misses
|
||||
//
|
||||
UpdateTapNotesMissedOlderThan( GAMESTATE->m_fSongBeat - GetMaxBeatDifference() );
|
||||
|
||||
int iNumMisses = UpdateTapNotesMissedOlderThan( GAMESTATE->m_fSongBeat - GetMaxBeatDifference() );
|
||||
if( iNumMisses > 0 )
|
||||
int kjsdfsd = 0;
|
||||
|
||||
//
|
||||
// update HoldNotes logic
|
||||
@@ -482,7 +483,7 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat )
|
||||
|
||||
void Player::CrossedRow( int iNoteRow )
|
||||
{
|
||||
if( PREFSMAN->m_bAutoPlay )
|
||||
if( PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstration )
|
||||
{
|
||||
// check to see if there's at the crossed row
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
struct PlayerOptions
|
||||
{
|
||||
float m_fArrowScrollSpeed;
|
||||
enum EffectType { EFFECT_NONE=0, EFFECT_BOOST, EFFECT_WAVE, EFFECT_DRUNK, EFFECT_DIZZY, EFFECT_SPACE, EFFECT_MINI };
|
||||
enum EffectType { EFFECT_NONE=0, EFFECT_BOOST, EFFECT_WAVE, EFFECT_DRUNK, EFFECT_DIZZY, EFFECT_SPACE, EFFECT_MINI, NUM_EFFECT_TYPES };
|
||||
EffectType m_EffectType;
|
||||
enum AppearanceType { APPEARANCE_VISIBLE=0, APPEARANCE_HIDDEN, APPEARANCE_SUDDEN, APPEARANCE_STEALTH, APPEARANCE_BLINK };
|
||||
enum AppearanceType { APPEARANCE_VISIBLE=0, APPEARANCE_HIDDEN, APPEARANCE_SUDDEN, APPEARANCE_STEALTH, APPEARANCE_BLINK, NUM_APPEARANCE_TYPES };
|
||||
AppearanceType m_AppearanceType;
|
||||
enum TurnType { TURN_NONE=0, TURN_MIRROR, TURN_LEFT, TURN_RIGHT, TURN_SHUFFLE };
|
||||
TurnType m_TurnType;
|
||||
bool m_bLittle;
|
||||
bool m_bReverseScroll;
|
||||
enum ColorType { COLOR_ARCADE=0, COLOR_NOTE, COLOR_FLAT, COLOR_PLAIN };
|
||||
enum ColorType { COLOR_ARCADE=0, COLOR_NOTE, COLOR_FLAT, COLOR_PLAIN, NUM_COLOR_TYPES };
|
||||
ColorType m_ColorType;
|
||||
bool m_bHoldNotes;
|
||||
bool m_bDark;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "ScoreDisplayNormal.h"
|
||||
#include "ScoreDisplayOni.h"
|
||||
#include "ScreenPrompt.h"
|
||||
#include "ScreenTitleMenu.h"
|
||||
|
||||
//
|
||||
// Defines
|
||||
@@ -53,7 +54,7 @@ const float SCORE_LOCALEZ2_X[NUM_PLAYERS] = { -240, +240 };
|
||||
const float SCORE_LOCALEZ2_Y[NUM_PLAYERS] = { -32, -32 };
|
||||
|
||||
const float PLAYER_OPTIONS_LOCAL_X[NUM_PLAYERS] = { -0, +0 };
|
||||
const float PLAYER_OPTIONS_LOCAL_Y[NUM_PLAYERS] = { -10, +10 };
|
||||
const float PLAYER_OPTIONS_LOCAL_Y[NUM_PLAYERS] = { -12, +2 };
|
||||
|
||||
const float DIFFICULTY_X[NUM_PLAYERS] = { SCREEN_LEFT+60, SCREEN_RIGHT-60 };
|
||||
const float DIFFICULTY_Y[NUM_PLAYERS] = { SCREEN_BOTTOM-70, SCREEN_BOTTOM-70 };
|
||||
@@ -66,11 +67,13 @@ const float SURVIVE_TIME_Y = CENTER_Y+100;
|
||||
|
||||
const float TIME_BETWEEN_DANCING_COMMENTS = 13;
|
||||
|
||||
const float DEMONSTRATION_TIME = 30;
|
||||
|
||||
|
||||
// received while STATE_DANCING
|
||||
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+101);
|
||||
const ScreenMessage SM_BeginLoadingNextSong = ScreenMessage(SM_User+102);
|
||||
const ScreenMessage SM_LastNotesEnded = ScreenMessage(SM_User+103);
|
||||
const ScreenMessage SM_BeginFadingToTitleMenu = ScreenMessage(SM_User+103);
|
||||
|
||||
|
||||
// received while STATE_OUTRO
|
||||
@@ -85,6 +88,7 @@ const ScreenMessage SM_ShowFailed = ScreenMessage(SM_User+122);
|
||||
const ScreenMessage SM_PlayFailComment = ScreenMessage(SM_User+123);
|
||||
const ScreenMessage SM_HideFailed = ScreenMessage(SM_User+124);
|
||||
const ScreenMessage SM_GoToScreenAfterFail = ScreenMessage(SM_User+125);
|
||||
const ScreenMessage SM_GoToTitleMenu = ScreenMessage(SM_User+126);
|
||||
|
||||
|
||||
|
||||
@@ -94,6 +98,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
|
||||
|
||||
GAMESTATE->ResetStageStatistics(); // clear values
|
||||
|
||||
// Update possible dance points
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -389,7 +394,20 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_sprFailed.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprFailed );
|
||||
|
||||
m_Fade.SetClosed();
|
||||
if( GAMESTATE->m_bDemonstration )
|
||||
{
|
||||
m_quadDemonstrationBox.SetDiffuseColor( D3DXCOLOR(0,0,0,0.7f) );
|
||||
m_quadDemonstrationBox.StretchTo( CRect(SCREEN_LEFT, int(CENTER_Y-60), SCREEN_RIGHT, int(CENTER_Y+60)) );
|
||||
this->AddSubActor( &m_quadDemonstrationBox );
|
||||
|
||||
m_sprDemonstration.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DEMONSTRATION) );
|
||||
m_sprDemonstration.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprDemonstration.SetEffectBlinking();
|
||||
this->AddSubActor( &m_sprDemonstration );
|
||||
|
||||
m_Fade.OpenWipingRight();
|
||||
}
|
||||
|
||||
m_Fade.SetOpened();
|
||||
this->AddSubActor( &m_Fade );
|
||||
|
||||
@@ -403,40 +421,52 @@ ScreenGameplay::ScreenGameplay()
|
||||
|
||||
|
||||
|
||||
m_soundFail.Load( THEME->GetPathTo(SOUND_GAMEPLAY_FAILED) );
|
||||
m_soundOniDie.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_DIE) );
|
||||
m_announcerReady.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_READY) );
|
||||
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_EXTRA) );
|
||||
else if( GAMESTATE->IsFinalStage() )
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_FINAL) );
|
||||
else
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_NORMAL) );
|
||||
m_announcerDanger.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_DANGER) );
|
||||
m_announcerGood.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_GOOD) );
|
||||
m_announcerHot.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_HOT) );
|
||||
|
||||
m_announcer100Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_100_COMBO) );
|
||||
m_announcer200Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_200_COMBO) );
|
||||
m_announcer300Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_300_COMBO) );
|
||||
m_announcer400Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_400_COMBO) );
|
||||
m_announcer500Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_500_COMBO) );
|
||||
m_announcer600Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_600_COMBO) );
|
||||
m_announcer700Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_700_COMBO) );
|
||||
m_announcer800Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_800_COMBO) );
|
||||
m_announcer900Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_900_COMBO) );
|
||||
m_announcer1000Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_1000_COMBO) );
|
||||
m_announcerComboStopped.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMBO_STOPPED) );
|
||||
if( !GAMESTATE->m_bDemonstration ) // don't load sounds if just playing demonstration
|
||||
{
|
||||
m_soundFail.Load( THEME->GetPathTo(SOUND_GAMEPLAY_FAILED) );
|
||||
m_soundOniDie.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_DIE) );
|
||||
m_announcerReady.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_READY) );
|
||||
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_EXTRA) );
|
||||
else if( GAMESTATE->IsFinalStage() )
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_FINAL) );
|
||||
else
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_NORMAL) );
|
||||
m_announcerDanger.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_DANGER) );
|
||||
m_announcerGood.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_GOOD) );
|
||||
m_announcerHot.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_HOT) );
|
||||
|
||||
m_announcer100Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_100_COMBO) );
|
||||
m_announcer200Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_200_COMBO) );
|
||||
m_announcer300Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_300_COMBO) );
|
||||
m_announcer400Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_400_COMBO) );
|
||||
m_announcer500Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_500_COMBO) );
|
||||
m_announcer600Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_600_COMBO) );
|
||||
m_announcer700Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_700_COMBO) );
|
||||
m_announcer800Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_800_COMBO) );
|
||||
m_announcer900Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_900_COMBO) );
|
||||
m_announcer1000Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_1000_COMBO) );
|
||||
m_announcerComboStopped.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMBO_STOPPED) );
|
||||
}
|
||||
|
||||
m_soundAssistTick.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ASSIST_TICK) );
|
||||
|
||||
|
||||
LoadNextSong( true );
|
||||
|
||||
// Send some messages every have second to we can get the introduction rolling
|
||||
for( int i=0; i<30; i++ )
|
||||
this->SendScreenMessage( ScreenMessage(SM_User+i), i/2.0f );
|
||||
|
||||
if( GAMESTATE->m_bDemonstration )
|
||||
{
|
||||
m_StarWipe.SetOpened();
|
||||
m_DancingState = STATE_DANCING;
|
||||
m_soundMusic.Play();
|
||||
this->SendScreenMessage( SM_BeginFadingToTitleMenu, DEMONSTRATION_TIME );
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i=0; i<30; i++ )
|
||||
this->SendScreenMessage( ScreenMessage(SM_User+i), i/2.0f ); // Send messages to we can get the introduction rolling
|
||||
}
|
||||
}
|
||||
|
||||
ScreenGameplay::~ScreenGameplay()
|
||||
@@ -604,7 +634,6 @@ bool ScreenGameplay::AllFailedEarlier()
|
||||
void ScreenGameplay::Update( float fDeltaTime )
|
||||
{
|
||||
//LOG->Trace( "ScreenGameplay::Update(%f)", fDeltaTime );
|
||||
Screen::Update( fDeltaTime );
|
||||
|
||||
m_soundMusic.Update( fDeltaTime );
|
||||
|
||||
@@ -612,17 +641,19 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
return;
|
||||
|
||||
|
||||
// update the global music statistics for other classes to access
|
||||
float fPositionSeconds = m_soundMusic.GetPositionSeconds();
|
||||
float fSongBeat, fBPS;
|
||||
bool bFreeze;
|
||||
GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS, bFreeze );
|
||||
|
||||
|
||||
// update the global music statistics for other classes to access
|
||||
GAMESTATE->m_fMusicSeconds = fPositionSeconds;
|
||||
GAMESTATE->m_fSongBeat = fSongBeat;
|
||||
GAMESTATE->m_fCurBPS = fBPS;
|
||||
GAMESTATE->m_bFreeze = bFreeze;
|
||||
|
||||
// LOG->Trace( "GAMESTATE->m_fMusicSeconds = %f", GAMESTATE->m_fMusicSeconds );
|
||||
|
||||
|
||||
m_Background.SetSongBeat( fSongBeat, bFreeze, fPositionSeconds );
|
||||
@@ -666,14 +697,15 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
if( m_pLifeMeter[p]->IsFailing() && GAMESTATE->m_fSecondsBeforeFail[p] == -1 ) // not yet failed
|
||||
{
|
||||
// kill them!
|
||||
GAMESTATE->m_fSecondsBeforeFail[p] = GAMESTATE->GetElapsedSeconds();
|
||||
m_soundOniDie.PlayRandom();
|
||||
ShowOniGameOver((PlayerNumber)p);
|
||||
m_Player[p].Init(); // remove all notes and scoring
|
||||
m_Player[p].FadeToFail(); // tell the NoteField to fade to white
|
||||
}
|
||||
if( !AllFailedEarlier() ) // if not the last one to fail
|
||||
{
|
||||
// kill them!
|
||||
GAMESTATE->m_fSecondsBeforeFail[p] = GAMESTATE->GetElapsedSeconds();
|
||||
m_soundOniDie.PlayRandom();
|
||||
ShowOniGameOver((PlayerNumber)p);
|
||||
m_Player[p].Init(); // remove all notes and scoring
|
||||
m_Player[p].FadeToFail(); // tell the NoteField to fade to white
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -687,17 +719,22 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
//
|
||||
// Check to see if it's time to play a gameplay comment
|
||||
//
|
||||
m_fTimeLeftBeforeDancingComment -= fDeltaTime;
|
||||
if( m_fTimeLeftBeforeDancingComment <= 0 )
|
||||
if( !GAMESTATE->m_bDemonstration ) // don't play announcer comments in demonstration
|
||||
{
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS; // reset for the next comment
|
||||
m_fTimeLeftBeforeDancingComment -= fDeltaTime;
|
||||
if( m_fTimeLeftBeforeDancingComment <= 0 )
|
||||
{
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS; // reset for the next comment
|
||||
|
||||
if( OneIsHot() )
|
||||
m_announcerHot.PlayRandom();
|
||||
else if( AllAreInDanger() )
|
||||
m_announcerDanger.PlayRandom();
|
||||
else
|
||||
m_announcerGood.PlayRandom();
|
||||
|
||||
|
||||
if( OneIsHot() )
|
||||
m_announcerHot.PlayRandom();
|
||||
else if( AllAreInDanger() )
|
||||
m_announcerDanger.PlayRandom();
|
||||
else
|
||||
m_announcerGood.PlayRandom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,6 +796,9 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
|
||||
iRowLastCrossed = iRowNow;
|
||||
}
|
||||
|
||||
|
||||
Screen::Update( fDeltaTime );
|
||||
}
|
||||
|
||||
|
||||
@@ -772,9 +812,16 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
{
|
||||
//LOG->Trace( "ScreenGameplay::Input()" );
|
||||
|
||||
float fSongBeat, fBPS;
|
||||
bool bFreeze;
|
||||
GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( m_soundMusic.GetPositionSeconds(), fSongBeat, fBPS, bFreeze );
|
||||
if( GAMESTATE->m_bDemonstration )
|
||||
{
|
||||
if( MenuI.button == MENU_BUTTON_START )
|
||||
{
|
||||
m_soundMusic.Stop();
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_INSERT_COIN) );
|
||||
m_Fade.CloseWipingRight( SM_GoToTitleMenu );
|
||||
}
|
||||
return; // don't fall through below
|
||||
}
|
||||
|
||||
|
||||
// Handle special keys to adjust the offset
|
||||
@@ -806,7 +853,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
}
|
||||
if( type == IET_FAST_REPEAT )
|
||||
fOffsetDelta *= 10;
|
||||
BPMSegment& seg = GAMESTATE->m_pCurSong->GetBPMSegmentAtBeat( fSongBeat );
|
||||
BPMSegment& seg = GAMESTATE->m_pCurSong->GetBPMSegmentAtBeat( GAMESTATE->m_fSongBeat );
|
||||
|
||||
seg.m_fBPM += fOffsetDelta;
|
||||
|
||||
@@ -867,8 +914,6 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
//
|
||||
if( m_DancingState == STATE_DANCING )
|
||||
{
|
||||
const float fMaxBeatDifference = fBPS * PREFSMAN->m_fJudgeWindow * GAMESTATE->m_SongOptions.m_fMusicRate;
|
||||
|
||||
if( type == IET_FIRST_PRESS )
|
||||
{
|
||||
if( StyleI.IsValid() )
|
||||
@@ -880,7 +925,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
}
|
||||
}
|
||||
|
||||
void SaveChanges( void* pContext )
|
||||
void SaveChanges()
|
||||
{
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
@@ -902,7 +947,7 @@ void SaveChanges( void* pContext )
|
||||
}
|
||||
}
|
||||
|
||||
void DontSaveChanges( void* pContext )
|
||||
void DontSaveChanges()
|
||||
{
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
@@ -1060,6 +1105,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
LoadNextSong( false );
|
||||
m_OniFade.OpenWipingRight( SM_None );
|
||||
break;
|
||||
case SM_BeginFadingToTitleMenu:
|
||||
m_Fade.CloseWipingRight( SM_GoToTitleMenu );
|
||||
break;
|
||||
|
||||
case SM_100Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
@@ -1187,7 +1235,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_DancingState = STATE_OUTRO;
|
||||
m_soundMusic.Pause();
|
||||
m_StarWipe.CloseWipingRight( SM_None );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
m_Player[p].FadeToFail();
|
||||
|
||||
@@ -1258,6 +1307,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
else
|
||||
SCREENMAN->SetNewScreen( new ScreenGameOver );
|
||||
break;
|
||||
case SM_GoToTitleMenu:
|
||||
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,9 @@ private:
|
||||
Sprite m_sprOniGameOver[NUM_PLAYERS];
|
||||
void ShowOniGameOver( PlayerNumber p );
|
||||
|
||||
Quad m_quadDemonstrationBox;
|
||||
Sprite m_sprDemonstration;
|
||||
|
||||
RandomSample m_soundFail;
|
||||
RandomSample m_soundOniDie;
|
||||
RandomSample m_announcerReady;
|
||||
|
||||
@@ -26,7 +26,7 @@ const float PROMPT_X = CENTER_X;
|
||||
const float PROMPT_Y = CENTER_Y + 120;
|
||||
|
||||
|
||||
ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer, void(*OnYes)(void* pContext), void(*OnNo)(void* pContext) )
|
||||
ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer, void(*OnYes)(), void(*OnNo)() )
|
||||
{
|
||||
m_SMSendWhenDone = SM_SendWhenDone;
|
||||
m_pOnYes = OnYes;
|
||||
@@ -154,8 +154,12 @@ void ScreenPrompt::MenuStart( const PlayerNumber p )
|
||||
m_textAnswer[1].BeginTweening( 0.2f );
|
||||
m_textAnswer[1].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
|
||||
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
|
||||
if( m_bAnswer )
|
||||
m_pOnYes();
|
||||
else
|
||||
m_pOnNo();
|
||||
}
|
||||
|
||||
void ScreenPrompt::MenuBack( const PlayerNumber p )
|
||||
|
||||
@@ -25,7 +25,7 @@ class ScreenPrompt : public Screen
|
||||
{
|
||||
public:
|
||||
ScreenPrompt();
|
||||
ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL );
|
||||
ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer = false, void(*OnYes)() = NULL, void(*OnNo)() = NULL );
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void DrawPrimitives();
|
||||
@@ -46,7 +46,7 @@ protected:
|
||||
PromptType m_PromptType;
|
||||
bool m_bAnswer; // true = "YES", false = "NO";
|
||||
ScreenMessage m_SMSendWhenDone;
|
||||
void(*m_pOnYes)(void* pContext);
|
||||
void(*m_pOnNo)(void* pContext);
|
||||
void(*m_pOnYes)();
|
||||
void(*m_pOnNo)();
|
||||
};
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "ScreenEz2SelectPlayer.h"
|
||||
#include "GameState.h"
|
||||
#include "GameManager.h"
|
||||
#include "ScreenGameplay.h"
|
||||
|
||||
|
||||
//
|
||||
@@ -52,7 +53,7 @@ const float CHOICES_GAP_Y = 52;
|
||||
const float HELP_X = CENTER_X;
|
||||
const float HELP_Y = SCREEN_HEIGHT-55;
|
||||
|
||||
const CString EZ2_ANNOUNCER_NAME = "ez2";
|
||||
//const CString EZ2_ANNOUNCER_NAME = "ez2";
|
||||
|
||||
const ScreenMessage SM_PlayAttract = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_GoToCaution = ScreenMessage(SM_User+2);
|
||||
@@ -64,6 +65,12 @@ const ScreenMessage SM_GoToAppearanceOptions= ScreenMessage(SM_User+7);
|
||||
const ScreenMessage SM_GoToEdit = ScreenMessage(SM_User+10);
|
||||
const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User+11);
|
||||
const ScreenMessage SM_GoToEz2 = ScreenMessage(SM_User+12);
|
||||
const ScreenMessage SM_FadeToDemonstration = ScreenMessage(SM_User+13);
|
||||
const ScreenMessage SM_GoToDemonstration = ScreenMessage(SM_User+14);
|
||||
|
||||
|
||||
const float SECONDS_BEFORE_DEMONSTRATION = 5;
|
||||
|
||||
|
||||
ScreenTitleMenu::ScreenTitleMenu()
|
||||
{
|
||||
@@ -76,8 +83,6 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
INPUTMAPPER->ReadMappingsFromDisk();
|
||||
|
||||
|
||||
int i;
|
||||
|
||||
m_sprBG.Load( THEME->GetPathTo(GRAPHIC_TITLE_MENU_BACKGROUND) );
|
||||
m_sprBG.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
|
||||
m_sprBG.SetDiffuseColor( D3DXCOLOR(0.6f,0.6f,0.6f,1) );
|
||||
@@ -121,7 +126,7 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
this->AddSubActor( &m_textSongs );
|
||||
|
||||
|
||||
for( i=0; i< NUM_TITLE_MENU_CHOICES; i++ )
|
||||
for( int i=0; i< NUM_TITLE_MENU_CHOICES; i++ )
|
||||
{
|
||||
m_textChoice[i].Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textChoice[i].SetText( CHOICE_TEXT[i] );
|
||||
@@ -138,7 +143,7 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
/*
|
||||
|
||||
// Chris:
|
||||
// I'm removing thos not that announcer prefs are saved per Game.
|
||||
// I'm removing this now that announcer prefs are saved per Game.
|
||||
|
||||
// LEAVE THIS HERE! ITS ESSENTIAL
|
||||
// I know you're a fan of removing my code, but if this isn't here
|
||||
@@ -202,16 +207,14 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
m_soundInvalid.Load( THEME->GetPathTo(SOUND_MENU_INVALID) );
|
||||
|
||||
|
||||
for( i=0; i<3000; i++ )
|
||||
this->SendScreenMessage( SM_PlayAttract, (float)20+i*20 );
|
||||
|
||||
|
||||
m_TitleMenuChoice = CHOICE_GAME_START;
|
||||
GainFocus( m_TitleMenuChoice );
|
||||
|
||||
MUSIC->Stop();
|
||||
|
||||
//this->SendScreenMessage( SM_TimeToFadeOut, 30.0 );
|
||||
for( i=12; i<SECONDS_BEFORE_DEMONSTRATION; i+=10 )
|
||||
this->SendScreenMessage( SM_PlayAttract, (float)i );
|
||||
this->SendScreenMessage( SM_FadeToDemonstration, SECONDS_BEFORE_DEMONSTRATION );
|
||||
}
|
||||
|
||||
|
||||
@@ -237,9 +240,6 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
case SM_DoneOpening:
|
||||
break;
|
||||
case SM_PlayAttract:
|
||||
m_soundAttract.PlayRandom();
|
||||
break;
|
||||
case SM_GoToCaution:
|
||||
SCREENMAN->SetNewScreen( new ScreenCaution );
|
||||
break;
|
||||
@@ -264,6 +264,73 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
case SM_GoToEz2:
|
||||
SCREENMAN->SetNewScreen( new ScreenEz2SelectPlayer );
|
||||
break;
|
||||
case SM_FadeToDemonstration:
|
||||
{
|
||||
// Set up the game state for a demonstration
|
||||
switch( GAMESTATE->m_CurGame )
|
||||
{
|
||||
case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS; break;
|
||||
case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_VERSUS; break;
|
||||
case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE_VERSUS; break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
|
||||
GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE;
|
||||
|
||||
// choose a Song and Notes
|
||||
Song* pSongToPlay = NULL;
|
||||
Notes* pNotesToPlay = NULL;
|
||||
for( int i=0; i<100; i++ ) // try 100 times
|
||||
{
|
||||
Song* pSong = SONGMAN->m_pSongs[ rand()%SONGMAN->m_pSongs.GetSize() ];
|
||||
for( int j=0; j<10; j++ ) // try 10 times
|
||||
{
|
||||
Notes* pNotes = pSong->m_apNotes[ rand()%pSong->m_apNotes.GetSize() ];
|
||||
if( pNotes->m_NotesType == GAMESTATE->GetCurrentStyleDef()->m_NotesType )
|
||||
{
|
||||
// found something we can use!
|
||||
pSongToPlay = pSong;
|
||||
pNotesToPlay = pNotes;
|
||||
goto found_song_and_notes;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Couldn't find Song/Notes to play. Abort demonstration!
|
||||
GAMESTATE->Reset();
|
||||
return;
|
||||
|
||||
found_song_and_notes:
|
||||
ASSERT( pSongToPlay );
|
||||
|
||||
GAMESTATE->m_pCurSong = pSongToPlay;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
GAMESTATE->m_pCurNotes[p] = pNotesToPlay;
|
||||
|
||||
// choose some cool options
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
{
|
||||
GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = (RandomFloat(0,1)>0.7f ? 1.5f : 1.0f) ;
|
||||
GAMESTATE->m_PlayerOptions[p].m_EffectType = PlayerOptions::EffectType(rand()%PlayerOptions::NUM_EFFECT_TYPES);
|
||||
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::AppearanceType(rand()%(PlayerOptions::NUM_APPEARANCE_TYPES-1)); // don't use blink
|
||||
GAMESTATE->m_PlayerOptions[p].m_bReverseScroll = RandomFloat(0,1) > 0.8f;
|
||||
GAMESTATE->m_PlayerOptions[p].m_ColorType = PlayerOptions::ColorType(rand()%PlayerOptions::NUM_COLOR_TYPES);
|
||||
GAMESTATE->m_PlayerOptions[p].m_bDark = RandomFloat(0,1) > 0.8f;
|
||||
}
|
||||
}
|
||||
GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LifeType(rand()%SongOptions::NUM_LIFE_TYPES);
|
||||
|
||||
GAMESTATE->m_bDemonstration = true;
|
||||
m_Fade.CloseWipingRight( SM_GoToDemonstration );
|
||||
}
|
||||
break;
|
||||
case SM_GoToDemonstration:
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurSong );
|
||||
SCREENMAN->SetNewScreen( new ScreenGameplay );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
struct SongOptions
|
||||
{
|
||||
enum LifeType { LIFE_BAR=0, LIFE_BATTERY };
|
||||
enum LifeType { LIFE_BAR=0, LIFE_BATTERY, NUM_LIFE_TYPES };
|
||||
LifeType m_LifeType;
|
||||
enum DrainType { DRAIN_NORMAL, DRAIN_NO_RECOVER, DRAIN_SUDDEN_DEATH };
|
||||
DrainType m_DrainType; // only used with LifeBar
|
||||
|
||||
@@ -694,6 +694,7 @@ HRESULT CreateObjects( HWND hWnd )
|
||||
BringWindowToTop( hWnd );
|
||||
SetForegroundWindow( hWnd );
|
||||
|
||||
//SCREENMAN->SetNewScreen( new ScreenAttractLogo );
|
||||
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
|
||||
//SCREENMAN->SetNewScreen( new ScreenLoading );
|
||||
//SCREENMAN->SetNewScreen( new ScreenSandbox );
|
||||
|
||||
@@ -456,6 +456,14 @@ SOURCE=.\TransitionKeepAlive.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TransitionOniFade.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TransitionOniFade.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TransitionRectWipe.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -131,6 +131,7 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName )
|
||||
case GRAPHIC_GAMEPLAY_DANGER_TEXT: sAssetPrefix = "Graphics\\gameplay danger text"; break;
|
||||
case GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_ICONS: sAssetPrefix = "Graphics\\gameplay difficulty banner icons";break;
|
||||
case GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_FRAME: sAssetPrefix = "Graphics\\gameplay difficulty banner frame";break;
|
||||
case GRAPHIC_GAMEPLAY_DEMONSTRATION: sAssetPrefix = "Graphics\\gameplay demonstration"; break;
|
||||
case GRAPHIC_GAMEPLAY_FAILED: sAssetPrefix = "Graphics\\gameplay failed"; break;
|
||||
case GRAPHIC_GAMEPLAY_HERE_WE_GO: sAssetPrefix = "Graphics\\gameplay here we go"; break;
|
||||
case GRAPHIC_GAMEPLAY_JUDGEMENT: sAssetPrefix = "Graphics\\gameplay judgement 1x9"; break;
|
||||
@@ -247,6 +248,7 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName )
|
||||
case SOUND_GAMEPLAY_ONI_GAIN_LIFE: sAssetPrefix = "Sounds\\gameplay oni gain life"; break;
|
||||
case SOUND_GAMEPLAY_ONI_LOSE_LIFE: sAssetPrefix = "Sounds\\gameplay oni lose life"; break;
|
||||
case SOUND_GAMEPLAY_ONI_DIE: sAssetPrefix = "Sounds\\gameplay oni die"; break;
|
||||
case SOUND_INSERT_COIN: sAssetPrefix = "Sounds\\insert coin"; break;
|
||||
case SOUND_MENU_BACK: sAssetPrefix = "Sounds\\menu back"; break;
|
||||
case SOUND_MENU_EXPLANATION_SWOOSH: sAssetPrefix = "Sounds\\menu explanation swoosh"; break;
|
||||
case SOUND_MENU_INVALID: sAssetPrefix = "Sounds\\menu invalid"; break;
|
||||
|
||||
@@ -38,6 +38,7 @@ enum ThemeElement {
|
||||
GRAPHIC_GAMEPLAY_COMBO,
|
||||
GRAPHIC_GAMEPLAY_DANGER_BACKGROUND,
|
||||
GRAPHIC_GAMEPLAY_DANGER_TEXT,
|
||||
GRAPHIC_GAMEPLAY_DEMONSTRATION,
|
||||
GRAPHIC_GAMEPLAY_FAILED,
|
||||
GRAPHIC_GAMEPLAY_JUDGEMENT,
|
||||
GRAPHIC_GAMEPLAY_READY,
|
||||
@@ -151,6 +152,7 @@ enum ThemeElement {
|
||||
SOUND_EDIT_CHANGE_SNAP,
|
||||
SOUND_EDIT_SAVE,
|
||||
SOUND_EVALUATION_EXTRA_STAGE,
|
||||
SOUND_INSERT_COIN,
|
||||
SOUND_GAMEPLAY_ASSIST_TICK,
|
||||
SOUND_GAMEPLAY_FAILED,
|
||||
SOUND_GAMEPLAY_ONI_GAIN_LIFE,
|
||||
|
||||
Reference in New Issue
Block a user