From bdc55a8f99a9872b8f62a9fde22134326ff15b85 Mon Sep 17 00:00:00 2001 From: Ben Nordstrom Date: Thu, 29 Nov 2001 11:05:04 +0000 Subject: [PATCH] no message --- stepmania/src/GhostArrow.cpp | 44 ++++++++++++++++++++++ stepmania/src/GhostArrow.h | 26 +++++++++++++ stepmania/src/GrayArrow.cpp | 39 +++++++++++++++++++ stepmania/src/GrayArrow.h | 28 ++++++++++++++ stepmania/src/Player.cpp | 72 +++++++++++++++++------------------- stepmania/src/Player.h | 16 ++++++-- 6 files changed, 184 insertions(+), 41 deletions(-) create mode 100644 stepmania/src/GhostArrow.cpp create mode 100644 stepmania/src/GhostArrow.h create mode 100644 stepmania/src/GrayArrow.cpp create mode 100644 stepmania/src/GrayArrow.h diff --git a/stepmania/src/GhostArrow.cpp b/stepmania/src/GhostArrow.cpp new file mode 100644 index 0000000000..260ffc805e --- /dev/null +++ b/stepmania/src/GhostArrow.cpp @@ -0,0 +1,44 @@ +// GhostArrow.cpp: implementation of the GhostArrow class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "GhostArrow.h" + + + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +GhostArrow::GhostArrow() +{ + Arrow::Arrow(); + + m_sprOutline.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); + m_sprMidSection.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); + m_sprCenter.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); +} + + +void GhostArrow::Step() +{ + m_sprOutline.SetZoom( 1 ); + m_sprOutline.SetDiffuseColor( D3DXCOLOR(1,1,0.5f,1) ); + m_sprOutline.BeginTweening( 0.3f ); + m_sprOutline.SetTweenZoom( 1.5 ); + m_sprOutline.SetTweenDiffuseColor( D3DXCOLOR(1,1,0.5f,0) ); + + m_sprMidSection.SetZoom( 1 ); + m_sprMidSection.SetDiffuseColor( D3DXCOLOR(1,1,0.5f,1) ); + m_sprMidSection.BeginTweening( 0.3f ); + m_sprMidSection.SetTweenZoom( 1.5 ); + m_sprMidSection.SetTweenDiffuseColor( D3DXCOLOR(1,1,0.5f,0) ); + + m_sprCenter.SetZoom( 1 ); + m_sprCenter.SetDiffuseColor( D3DXCOLOR(1,1,0.5f,1) ); + m_sprCenter.BeginTweening( 0.3f ); + m_sprCenter.SetTweenZoom( 1.5 ); + m_sprCenter.SetTweenDiffuseColor( D3DXCOLOR(1,1,0.5f,0) ); +} \ No newline at end of file diff --git a/stepmania/src/GhostArrow.h b/stepmania/src/GhostArrow.h new file mode 100644 index 0000000000..7f0164e2f5 --- /dev/null +++ b/stepmania/src/GhostArrow.h @@ -0,0 +1,26 @@ +/* +----------------------------------------------------------------------------- + File: GhostArrow.h + + Desc: Class used to represent a ghost arrow on the screen. + + Copyright (c) 2001 Ben Norstrom. All rights reserved. +----------------------------------------------------------------------------- +*/ + + +#ifndef _GHOST_ARROW_H_ +#define _GHOST_ARROW_H_ + + +#include "Arrow.h" + +class GhostArrow : public Arrow +{ +public: + GhostArrow(); + + virtual void Step(); +}; + +#endif diff --git a/stepmania/src/GrayArrow.cpp b/stepmania/src/GrayArrow.cpp new file mode 100644 index 0000000000..b2db1b056a --- /dev/null +++ b/stepmania/src/GrayArrow.cpp @@ -0,0 +1,39 @@ +// GrayArrow.cpp: implementation of the GrayArrow class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "GrayArrow.h" + + +const float GRAY_ARROW_POP_UP_TIME = 0.30f; + + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction + +GrayArrow::GrayArrow() +{ + Arrow::Arrow(); + + m_sprOutline.SetDiffuseColor( D3DXCOLOR(0.6f,0.6f,0.6f,1) ); + m_sprMidSection.SetDiffuseColor( D3DXCOLOR(0.3f,0.3f,0.3f,1) ); + m_sprCenter.SetDiffuseColor( D3DXCOLOR(0.4f,0.4f,0.4f,1) ); +} + + +void GrayArrow::Step() +{ + m_sprOutline.SetZoom( 0.50 ); + m_sprOutline.BeginTweening( GRAY_ARROW_POP_UP_TIME ); + m_sprOutline.SetTweenZoom( 1.0f ); + + m_sprMidSection.SetZoom( 0.50 ); + m_sprMidSection.BeginTweening( GRAY_ARROW_POP_UP_TIME ); + m_sprMidSection.SetTweenZoom( 1.0f ); + + m_sprCenter.SetZoom( 0.50 ); + m_sprCenter.BeginTweening( GRAY_ARROW_POP_UP_TIME ); + m_sprCenter.SetTweenZoom( 1.0f ); +} diff --git a/stepmania/src/GrayArrow.h b/stepmania/src/GrayArrow.h new file mode 100644 index 0000000000..d8a23b9c41 --- /dev/null +++ b/stepmania/src/GrayArrow.h @@ -0,0 +1,28 @@ +/* +----------------------------------------------------------------------------- + File: GrayArrow.h + + Desc: Class used to represent a gray arrow on the screen. + + Copyright (c) 2001 Ben Norstrom. All rights reserved. +----------------------------------------------------------------------------- +*/ + + +#ifndef _GRAYARROW_H_ +#define _GRAYARROW_H_ + + +#include "Arrow.h" + +class GrayArrow : public Arrow +{ +public: + GrayArrow(); + + // animates a step on the arrow + virtual void Step(); + +}; + +#endif diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index c630b8c2a7..e7f4ea663e 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -35,13 +35,9 @@ const float ARROW_X_OFFSET[6] = { }; const float GRAY_ARROW_Y = ARROW_SIZE * 1.5; -const float GRAY_ARROW_POP_UP_TIME = 0.30f; const float ARROW_GAP = 70; const int NUM_FRAMES_IN_COLOR_ARROW_SPRITE = 12; -const CString SPRITE_COLOR_ARROW = "Sprites\\Color Arrow.sprite"; -const CString SPRITE_GRAY_ARROW = "Sprites\\Gray Arrow.sprite"; - const float JUDGEMENT_DISPLAY_TIME = 0.6f; const CString JUDGEMENT_SPRITE = "Sprites\\Judgement.sprite"; @@ -173,19 +169,12 @@ Player::Player() for( int c=0; c < MAX_NUM_COLUMNS; c++ ) { // gray arrows - m_sprGrayArrow[c].LoadFromSpriteFile( SPRITE_GRAY_ARROW ); - m_sprGrayArrow[c].SetRotation( m_ColumnToRotation[c] ); + m_GrayArrow[c].SetRotation( m_ColumnToRotation[c] ); - m_sprGrayArrowGhost[c].LoadFromSpriteFile( SPRITE_GRAY_ARROW ); - m_sprGrayArrowGhost[c].SetRotation( m_ColumnToRotation[c] ); - m_sprGrayArrowGhost[c].StopAnimating(); - m_sprGrayArrowGhost[c].SetState( 1 ); - m_sprGrayArrowGhost[c].SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); + m_GhostArrow[c].SetRotation( m_ColumnToRotation[c] ); // color arrows - m_sprColorArrow[c].LoadFromSpriteFile( SPRITE_COLOR_ARROW ); - m_sprColorArrow[c].StopAnimating(); - m_sprColorArrow[c].SetRotation( m_ColumnToRotation[c] ); + m_ColorArrow[c].SetRotation( m_ColumnToRotation[c] ); } // judgement @@ -217,6 +206,7 @@ void Player::SetX( float fX ) m_fArrowsCenterX = fX; SetGrayArrowsX(fX); + SetGhostArrowsX(fX); SetColorArrowsX(fX); SetJudgementX(fX); SetComboX(fX); @@ -430,52 +420,62 @@ float Player::GetArrowColumnX( int iColNum ) void Player::UpdateGrayArrows( const float &fDeltaTime ) { for( int i=0; i < m_iNumColumns; i++ ) { - m_sprGrayArrow[i].Update( fDeltaTime ); - m_sprGrayArrowGhost[i].Update( fDeltaTime ); + m_GrayArrow[i].Update( fDeltaTime ); + m_GhostArrow[i].Update( fDeltaTime ); } } void Player::DrawGrayArrows() { for( int i=0; i