tweaked colors and added particle flash
This commit is contained in:
+15
-11
@@ -25,7 +25,7 @@ void Actor::Init()
|
|||||||
m_pos = m_start_pos = m_end_pos = D3DXVECTOR2( 0, 0 );
|
m_pos = m_start_pos = m_end_pos = D3DXVECTOR2( 0, 0 );
|
||||||
m_rotation = m_start_rotation = m_end_rotation = D3DXVECTOR3( 0, 0, 0 );
|
m_rotation = m_start_rotation = m_end_rotation = D3DXVECTOR3( 0, 0, 0 );
|
||||||
m_scale = m_start_scale = m_end_scale = D3DXVECTOR2( 1, 1 );
|
m_scale = m_start_scale = m_end_scale = D3DXVECTOR2( 1, 1 );
|
||||||
m_colorDiffuse = m_start_colorDiffuse = m_end_colorDiffuse= D3DXCOLOR( 1, 1, 1, 1 );
|
for(int i=0; i<4; i++) m_colorDiffuse[i] = m_start_colorDiffuse[i] = m_end_colorDiffuse[i]= D3DXCOLOR( 1, 1, 1, 1 );
|
||||||
m_colorAdd = m_start_colorAdd = m_end_colorAdd = D3DXCOLOR( 0, 0, 0, 0 );
|
m_colorAdd = m_start_colorAdd = m_end_colorAdd = D3DXCOLOR( 0, 0, 0, 0 );
|
||||||
|
|
||||||
m_TweenType = no_tween;
|
m_TweenType = no_tween;
|
||||||
@@ -147,7 +147,7 @@ void Actor::Update( const float &fDeltaTime )
|
|||||||
m_pos = m_end_pos;
|
m_pos = m_end_pos;
|
||||||
m_scale = m_end_scale;
|
m_scale = m_end_scale;
|
||||||
m_rotation = m_end_rotation;
|
m_rotation = m_end_rotation;
|
||||||
m_colorDiffuse = m_end_colorDiffuse;
|
for(int i=0; i<4; i++) m_colorDiffuse[i] = m_end_colorDiffuse[i];
|
||||||
m_colorAdd = m_end_colorAdd;
|
m_colorAdd = m_end_colorAdd;
|
||||||
m_TweenType = no_tween;
|
m_TweenType = no_tween;
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ void Actor::Update( const float &fDeltaTime )
|
|||||||
m_pos = m_start_pos + (m_end_pos - m_start_pos )*fPercentThroughTween;
|
m_pos = m_start_pos + (m_end_pos - m_start_pos )*fPercentThroughTween;
|
||||||
m_scale = m_start_scale + (m_end_scale - m_start_scale )*fPercentThroughTween;
|
m_scale = m_start_scale + (m_end_scale - m_start_scale )*fPercentThroughTween;
|
||||||
m_rotation = m_start_rotation+ (m_end_rotation - m_start_rotation)*fPercentThroughTween;
|
m_rotation = m_start_rotation+ (m_end_rotation - m_start_rotation)*fPercentThroughTween;
|
||||||
m_colorDiffuse = m_start_colorDiffuse*(1.0f-fPercentThroughTween) + m_end_colorDiffuse*(fPercentThroughTween);
|
for(int i=0; i<4; i++) m_colorDiffuse[i] = m_start_colorDiffuse[i]*(1.0f-fPercentThroughTween) + m_end_colorDiffuse[i]*(fPercentThroughTween);
|
||||||
m_colorAdd = m_start_colorAdd *(1.0f-fPercentThroughTween) + m_end_colorAdd *(fPercentThroughTween);
|
m_colorAdd = m_start_colorAdd *(1.0f-fPercentThroughTween) + m_end_colorAdd *(fPercentThroughTween);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ void Actor::TweenTo( float time, float x, float y, float zoom, float rot, D3DXCO
|
|||||||
m_start_pos = m_pos;
|
m_start_pos = m_pos;
|
||||||
m_start_scale = m_scale;
|
m_start_scale = m_scale;
|
||||||
m_start_rotation = m_rotation;
|
m_start_rotation = m_rotation;
|
||||||
m_start_colorDiffuse = m_colorDiffuse;
|
for(int i=0; i<4; i++) m_start_colorDiffuse[i] = m_colorDiffuse[i];
|
||||||
|
|
||||||
// set the ending tweening position to what the user asked for
|
// set the ending tweening position to what the user asked for
|
||||||
m_end_pos.x = (float)x;
|
m_end_pos.x = (float)x;
|
||||||
@@ -188,7 +188,7 @@ void Actor::TweenTo( float time, float x, float y, float zoom, float rot, D3DXCO
|
|||||||
m_end_scale.x = zoom;
|
m_end_scale.x = zoom;
|
||||||
m_end_scale.y = zoom;
|
m_end_scale.y = zoom;
|
||||||
m_end_rotation.z = rot;
|
m_end_rotation.z = rot;
|
||||||
m_end_colorDiffuse = col;
|
for(i=0; i<4; i++) m_end_colorDiffuse[i] = col;
|
||||||
m_TweenType = tt;
|
m_TweenType = tt;
|
||||||
m_fTweenTime = time;
|
m_fTweenTime = time;
|
||||||
m_fTimeIntoTween = 0;
|
m_fTimeIntoTween = 0;
|
||||||
@@ -202,7 +202,7 @@ void Actor::BeginTweening( float time, TweenType tt )
|
|||||||
m_start_pos = m_end_pos = m_pos;
|
m_start_pos = m_end_pos = m_pos;
|
||||||
m_start_scale = m_end_scale = m_scale;
|
m_start_scale = m_end_scale = m_scale;
|
||||||
m_start_rotation = m_end_rotation = m_rotation;
|
m_start_rotation = m_end_rotation = m_rotation;
|
||||||
m_start_colorDiffuse = m_end_colorDiffuse = m_colorDiffuse;
|
for(int i=0; i<4; i++)m_start_colorDiffuse[i] = m_end_colorDiffuse[i] = m_colorDiffuse[i];
|
||||||
m_start_colorAdd = m_end_colorAdd = m_colorAdd;
|
m_start_colorAdd = m_end_colorAdd = m_colorAdd;
|
||||||
|
|
||||||
m_TweenType = tt;
|
m_TweenType = tt;
|
||||||
@@ -217,7 +217,7 @@ void Actor::SetTweenZoom( float zoom ) { m_end_scale.x = zoom; m_end_scale.y =
|
|||||||
void Actor::SetTweenRotationX( float r ) { m_end_rotation.x = r; }
|
void Actor::SetTweenRotationX( float r ) { m_end_rotation.x = r; }
|
||||||
void Actor::SetTweenRotationY( float r ) { m_end_rotation.y = r; }
|
void Actor::SetTweenRotationY( float r ) { m_end_rotation.y = r; }
|
||||||
void Actor::SetTweenRotationZ( float r ) { m_end_rotation.z = r; }
|
void Actor::SetTweenRotationZ( float r ) { m_end_rotation.z = r; }
|
||||||
void Actor::SetTweenDiffuseColor( D3DXCOLOR c ) { m_end_colorDiffuse = c; }
|
void Actor::SetTweenDiffuseColor( D3DXCOLOR c ) { for(int i=0; i<4; i++) m_end_colorDiffuse[i] = c; }
|
||||||
void Actor::SetTweenAddColor( D3DXCOLOR c ) { m_end_colorAdd = c; }
|
void Actor::SetTweenAddColor( D3DXCOLOR c ) { m_end_colorAdd = c; }
|
||||||
|
|
||||||
|
|
||||||
@@ -290,8 +290,10 @@ void Actor::SetEffectNone()
|
|||||||
void Actor::SetEffectBlinking( float fDeltaPercentPerSecond, D3DXCOLOR Color, D3DXCOLOR Color2 )
|
void Actor::SetEffectBlinking( float fDeltaPercentPerSecond, D3DXCOLOR Color, D3DXCOLOR Color2 )
|
||||||
{
|
{
|
||||||
m_Effect = blinking;
|
m_Effect = blinking;
|
||||||
m_start_colorDiffuse = Color;
|
for(int i=0; i<4; i++) {
|
||||||
m_end_colorDiffuse = Color2;
|
m_start_colorDiffuse[i] = Color;
|
||||||
|
m_end_colorDiffuse[i] = Color2;
|
||||||
|
}
|
||||||
//m_fPercentBetweenColors = 0.0;
|
//m_fPercentBetweenColors = 0.0;
|
||||||
//m_bTweeningTowardEndColor = TRUE;
|
//m_bTweeningTowardEndColor = TRUE;
|
||||||
m_fDeltaPercentPerSecond = fDeltaPercentPerSecond;
|
m_fDeltaPercentPerSecond = fDeltaPercentPerSecond;
|
||||||
@@ -300,8 +302,10 @@ void Actor::SetEffectBlinking( float fDeltaPercentPerSecond, D3DXCOLOR Color, D3
|
|||||||
void Actor::SetEffectCamelion( float fDeltaPercentPerSecond, D3DXCOLOR Color, D3DXCOLOR Color2 )
|
void Actor::SetEffectCamelion( float fDeltaPercentPerSecond, D3DXCOLOR Color, D3DXCOLOR Color2 )
|
||||||
{
|
{
|
||||||
m_Effect = camelion;
|
m_Effect = camelion;
|
||||||
m_start_colorDiffuse = Color;
|
for(int i=0; i<4; i++) {
|
||||||
m_end_colorDiffuse = Color2;
|
m_start_colorDiffuse[i] = Color;
|
||||||
|
m_end_colorDiffuse[i] = Color2;
|
||||||
|
}
|
||||||
//m_fPercentBetweenColors = 0.0;
|
//m_fPercentBetweenColors = 0.0;
|
||||||
//m_bTweeningTowardEndColor = TRUE;
|
//m_bTweeningTowardEndColor = TRUE;
|
||||||
m_fDeltaPercentPerSecond = fDeltaPercentPerSecond;
|
m_fDeltaPercentPerSecond = fDeltaPercentPerSecond;
|
||||||
|
|||||||
+12
-4
@@ -60,8 +60,16 @@ public:
|
|||||||
virtual float GetRotationY() { return m_rotation.y; }
|
virtual float GetRotationY() { return m_rotation.y; }
|
||||||
virtual void SetRotationY( float rot ) { m_rotation.y = rot; }
|
virtual void SetRotationY( float rot ) { m_rotation.y = rot; }
|
||||||
|
|
||||||
virtual void SetDiffuseColor( D3DXCOLOR colorDiffuse ) { m_colorDiffuse = colorDiffuse; };
|
virtual void SetDiffuseColor( D3DXCOLOR colorDiffuse ) { for(int i=0; i<4; i++) m_colorDiffuse[i] = colorDiffuse; };
|
||||||
virtual D3DXCOLOR GetDiffuseColor() { return m_colorDiffuse; };
|
virtual void SetDiffuseColorUpperLeft( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[0] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorUpperRight( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[1] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorLowerLeft( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[2] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorLowerRight( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[3] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorTopEdge( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[0] = m_colorDiffuse[1] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorRightEdge( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[1] = m_colorDiffuse[3] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorBottomEdge( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[2] = m_colorDiffuse[3] = colorDiffuse; };
|
||||||
|
virtual void SetDiffuseColorLeftEdge( D3DXCOLOR colorDiffuse ) { m_colorDiffuse[0] = m_colorDiffuse[2] = colorDiffuse; };
|
||||||
|
virtual D3DXCOLOR GetDiffuseColor() { return m_colorDiffuse[0]; };
|
||||||
virtual void SetAddColor( D3DXCOLOR colorAdd ) { m_colorAdd = colorAdd; };
|
virtual void SetAddColor( D3DXCOLOR colorAdd ) { m_colorAdd = colorAdd; };
|
||||||
virtual D3DXCOLOR GetAddColor() { return m_colorAdd; };
|
virtual D3DXCOLOR GetAddColor() { return m_colorAdd; };
|
||||||
|
|
||||||
@@ -126,14 +134,14 @@ protected:
|
|||||||
D3DXVECTOR2 m_pos; // X-Y coordinate of where the center point will appear on screen
|
D3DXVECTOR2 m_pos; // X-Y coordinate of where the center point will appear on screen
|
||||||
D3DXVECTOR3 m_rotation; // X, Y, and Z m_rotation
|
D3DXVECTOR3 m_rotation; // X, Y, and Z m_rotation
|
||||||
D3DXVECTOR2 m_scale; // X and Y zooming
|
D3DXVECTOR2 m_scale; // X and Y zooming
|
||||||
D3DXCOLOR m_colorDiffuse;
|
D3DXCOLOR m_colorDiffuse[4]; // 4 corner colors - left to right, top to bottom
|
||||||
D3DXCOLOR m_colorAdd;
|
D3DXCOLOR m_colorAdd;
|
||||||
|
|
||||||
// start and end position for tweening
|
// start and end position for tweening
|
||||||
D3DXVECTOR2 m_start_pos, m_end_pos;
|
D3DXVECTOR2 m_start_pos, m_end_pos;
|
||||||
D3DXVECTOR3 m_start_rotation, m_end_rotation;
|
D3DXVECTOR3 m_start_rotation, m_end_rotation;
|
||||||
D3DXVECTOR2 m_start_scale, m_end_scale;
|
D3DXVECTOR2 m_start_scale, m_end_scale;
|
||||||
D3DXCOLOR m_start_colorDiffuse, m_end_colorDiffuse;
|
D3DXCOLOR m_start_colorDiffuse[4],m_end_colorDiffuse[4];
|
||||||
D3DXCOLOR m_start_colorAdd, m_end_colorAdd;
|
D3DXCOLOR m_start_colorAdd, m_end_colorAdd;
|
||||||
|
|
||||||
// counters for tweening
|
// counters for tweening
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
//
|
||||||
|
// GhostArrow.cpp: implementation of the GhostArrow class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "GhostArrow.h"
|
||||||
|
|
||||||
|
|
||||||
|
const CString GHOST_ARROW_SPRITE = "Sprites\\Ghost Arrow.sprite";
|
||||||
|
const float GRAY_ARROW_TWEEN_TIME = 0.5f;
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// Construction/Destruction
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GhostArrow::GhostArrow()
|
||||||
|
{
|
||||||
|
LoadFromSpriteFile( GHOST_ARROW_SPRITE );
|
||||||
|
SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void GhostArrow::SetBeat( const float fSongBeat )
|
||||||
|
{
|
||||||
|
//SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void GhostArrow::Step( StepScore score )
|
||||||
|
{
|
||||||
|
switch( score )
|
||||||
|
{
|
||||||
|
case perfect: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,1.0f) ); break; // yellow
|
||||||
|
case great: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,1.0f) ); break; // green
|
||||||
|
case good: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,1.0f) ); break;
|
||||||
|
case boo: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,1.0f) ); break;
|
||||||
|
case miss: ASSERT(true); break;
|
||||||
|
}
|
||||||
|
SetState( 0 );
|
||||||
|
SetZoom( 1.2f );
|
||||||
|
BeginTweening( 0.3f );
|
||||||
|
SetTweenZoom( 2.5f );
|
||||||
|
D3DXCOLOR colorTween = GetDiffuseColor();
|
||||||
|
colorTween.a = 0;
|
||||||
|
SetTweenDiffuseColor( colorTween );
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
File: GhostArrow.h
|
||||||
|
|
||||||
|
Desc: Class used to represent a color arrow on the screen.
|
||||||
|
|
||||||
|
Copyright (c) 2001 Ben Norstrom. All rights reserved.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
class GhostArrow;
|
||||||
|
|
||||||
|
#ifndef _GhostArrow_H_
|
||||||
|
#define _GhostArrow_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include "Sprite.h"
|
||||||
|
#include "Steps.h"
|
||||||
|
|
||||||
|
|
||||||
|
class GhostArrow : public Sprite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GhostArrow();
|
||||||
|
|
||||||
|
void SetBeat( const float fSongBeat );
|
||||||
|
void Step( StepScore score );
|
||||||
|
|
||||||
|
float m_fVisibilityCountdown;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
//
|
||||||
|
// GrayArrow.cpp: implementation of the GrayArrow class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "GrayArrow.h"
|
||||||
|
|
||||||
|
|
||||||
|
const CString GRAY_ARROW_TEXTURE = "Textures\\Gray Arrow 1x2.png";
|
||||||
|
const float GRAY_ARROW_POP_UP_TIME = 0.3f;
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// Construction/Destruction
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GrayArrow::GrayArrow()
|
||||||
|
{
|
||||||
|
LoadFromTexture( GRAY_ARROW_TEXTURE );
|
||||||
|
StopAnimating();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GrayArrow::SetBeat( const float fSongBeat )
|
||||||
|
{
|
||||||
|
SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void GrayArrow::Step( StepScore score )
|
||||||
|
{
|
||||||
|
SetZoom( 0.50 );
|
||||||
|
BeginTweening( GRAY_ARROW_POP_UP_TIME );
|
||||||
|
SetTweenZoom( 1.0f );
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
File: GrayArrow.h
|
||||||
|
|
||||||
|
Desc: Class used to represent a color arrow on the screen.
|
||||||
|
|
||||||
|
Copyright (c) 2001 Ben Norstrom. All rights reserved.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _GrayArrow_H_
|
||||||
|
#define _GrayArrow_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include "Sprite.h"
|
||||||
|
#include "Steps.h"
|
||||||
|
|
||||||
|
class GrayArrow : public Sprite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GrayArrow();
|
||||||
|
|
||||||
|
virtual void SetBeat( const float fSongBeat );
|
||||||
|
void Step( StepScore score );
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
+44
-26
@@ -167,13 +167,10 @@ Player::Player()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// init arrow rotations
|
||||||
for( int c=0; c < MAX_NUM_COLUMNS; c++ ) {
|
for( int c=0; c < MAX_NUM_COLUMNS; c++ ) {
|
||||||
// gray arrows
|
|
||||||
m_GrayArrow[c].SetRotation( m_ColumnToRotation[c] );
|
m_GrayArrow[c].SetRotation( m_ColumnToRotation[c] );
|
||||||
|
|
||||||
m_GhostArrow[c].SetRotation( m_ColumnToRotation[c] );
|
m_GhostArrow[c].SetRotation( m_ColumnToRotation[c] );
|
||||||
|
|
||||||
// color arrows
|
|
||||||
m_ColorArrow[c].SetRotation( m_ColumnToRotation[c] );
|
m_ColorArrow[c].SetRotation( m_ColumnToRotation[c] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,6 +258,7 @@ void Player::Update( const float &fDeltaTime, float fSongBeat, float fMaxBeatDif
|
|||||||
|
|
||||||
UpdateGrayArrows( fDeltaTime );
|
UpdateGrayArrows( fDeltaTime );
|
||||||
UpdateColorArrows( fDeltaTime );
|
UpdateColorArrows( fDeltaTime );
|
||||||
|
UpdateGhostArrows( fDeltaTime );
|
||||||
UpdateJudgement( fDeltaTime );
|
UpdateJudgement( fDeltaTime );
|
||||||
UpdateCombo( fDeltaTime );
|
UpdateCombo( fDeltaTime );
|
||||||
UpdateScore( fDeltaTime );
|
UpdateScore( fDeltaTime );
|
||||||
@@ -271,6 +269,7 @@ void Player::Draw()
|
|||||||
{
|
{
|
||||||
DrawGrayArrows();
|
DrawGrayArrows();
|
||||||
DrawColorArrows();
|
DrawColorArrows();
|
||||||
|
DrawGhostArrows();
|
||||||
DrawJudgement();
|
DrawJudgement();
|
||||||
DrawCombo();
|
DrawCombo();
|
||||||
DrawScore();
|
DrawScore();
|
||||||
@@ -284,7 +283,7 @@ void Player::HandlePlayerStep( float fSongBeat, Step player_step, float fMaxBeat
|
|||||||
|
|
||||||
// update gray arrows
|
// update gray arrows
|
||||||
int iColumnNum = m_StepToColumnNumber[player_step];
|
int iColumnNum = m_StepToColumnNumber[player_step];
|
||||||
GrayArrowStep( iColumnNum );
|
GrayArrowStep( iColumnNum, perfect );
|
||||||
|
|
||||||
CheckForCompleteStep( fSongBeat, player_step, fMaxBeatDiff );
|
CheckForCompleteStep( fSongBeat, player_step, fMaxBeatDiff );
|
||||||
}
|
}
|
||||||
@@ -342,12 +341,6 @@ void Player::OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDi
|
|||||||
{
|
{
|
||||||
float fStepBeat = StepIndexToBeat( iIndexThatWasSteppedOn );
|
float fStepBeat = StepIndexToBeat( iIndexThatWasSteppedOn );
|
||||||
|
|
||||||
// show the gray arrow ghost
|
|
||||||
for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column
|
|
||||||
if( m_OriginalStep[iIndexThatWasSteppedOn] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on?
|
|
||||||
GrayArrowGhostStep( c );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float fBeatsUntilStep = fStepBeat - fSongBeat;
|
float fBeatsUntilStep = fStepBeat - fSongBeat;
|
||||||
float fPercentFromPerfect = (float)fabs( fBeatsUntilStep / fMaxBeatDiff );
|
float fPercentFromPerfect = (float)fabs( fBeatsUntilStep / fMaxBeatDiff );
|
||||||
@@ -368,6 +361,13 @@ void Player::OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDi
|
|||||||
ChangeScore( stepscore, m_iCurCombo );
|
ChangeScore( stepscore, m_iCurCombo );
|
||||||
ChangeLife( stepscore );
|
ChangeLife( stepscore );
|
||||||
|
|
||||||
|
// show the gray arrow ghost
|
||||||
|
for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column
|
||||||
|
if( m_OriginalStep[iIndexThatWasSteppedOn] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on?
|
||||||
|
GhostArrowStep( c, stepscore );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// update the combo display
|
// update the combo display
|
||||||
switch( stepscore )
|
switch( stepscore )
|
||||||
{
|
{
|
||||||
@@ -443,6 +443,12 @@ void Player::UpdateGrayArrows( const float &fDeltaTime )
|
|||||||
{
|
{
|
||||||
for( int i=0; i < m_iNumColumns; i++ ) {
|
for( int i=0; i < m_iNumColumns; i++ ) {
|
||||||
m_GrayArrow[i].Update( fDeltaTime );
|
m_GrayArrow[i].Update( fDeltaTime );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::UpdateGhostArrows( const float &fDeltaTime )
|
||||||
|
{
|
||||||
|
for( int i=0; i < m_iNumColumns; i++ ) {
|
||||||
m_GhostArrow[i].Update( fDeltaTime );
|
m_GhostArrow[i].Update( fDeltaTime );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,11 +457,20 @@ void Player::DrawGrayArrows()
|
|||||||
{
|
{
|
||||||
for( int i=0; i<m_iNumColumns; i++ )
|
for( int i=0; i<m_iNumColumns; i++ )
|
||||||
{
|
{
|
||||||
m_GrayArrow[i].CalculateColor( m_fSongBeat );
|
m_GrayArrow[i].SetBeat( m_fSongBeat );
|
||||||
m_GrayArrow[i].Draw();
|
m_GrayArrow[i].Draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::DrawGhostArrows()
|
||||||
|
{
|
||||||
|
for( int i=0; i<m_iNumColumns; i++ )
|
||||||
|
{
|
||||||
|
m_GhostArrow[i].SetBeat( m_fSongBeat );
|
||||||
|
m_GhostArrow[i].Draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::SetGrayArrowsX( int iNewX )
|
void Player::SetGrayArrowsX( int iNewX )
|
||||||
{
|
{
|
||||||
for( int i=0; i<m_iNumColumns; i++ )
|
for( int i=0; i<m_iNumColumns; i++ )
|
||||||
@@ -474,14 +489,14 @@ void Player::SetColorArrowsX( int iNewX )
|
|||||||
m_ColorArrow[i].SetX( GetArrowColumnX(i) );
|
m_ColorArrow[i].SetX( GetArrowColumnX(i) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::GrayArrowStep( int index )
|
void Player::GrayArrowStep( int index, StepScore score )
|
||||||
{
|
{
|
||||||
m_GrayArrow[index].Step();
|
m_GrayArrow[index].Step( perfect );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::GrayArrowGhostStep( int index )
|
void Player::GhostArrowStep( int index, StepScore score )
|
||||||
{
|
{
|
||||||
m_GhostArrow[index].Step();
|
m_GhostArrow[index].Step( score );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::UpdateColorArrows( const float &fDeltaTime )
|
void Player::UpdateColorArrows( const float &fDeltaTime )
|
||||||
@@ -525,7 +540,7 @@ void Player::DrawColorArrows()
|
|||||||
for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column
|
for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column
|
||||||
if( m_OriginalStep[i] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on?
|
if( m_OriginalStep[i] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on?
|
||||||
m_ColorArrow[c].SetY( fYPos );
|
m_ColorArrow[c].SetY( fYPos );
|
||||||
m_ColorArrow[c].CalculateColor( fBeatsTilStep );
|
m_ColorArrow[c].SetIndexAndBeat( i, m_fSongBeat );
|
||||||
m_ColorArrow[c].Draw();
|
m_ColorArrow[c].Draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -533,10 +548,6 @@ void Player::DrawColorArrows()
|
|||||||
|
|
||||||
} // end if there is a step
|
} // end if there is a step
|
||||||
} // end foreach arrow to draw
|
} // end foreach arrow to draw
|
||||||
|
|
||||||
for( i=0; i<m_iNumColumns; i++ ) {
|
|
||||||
m_GhostArrow[i].Draw();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -554,7 +565,7 @@ float Player::GetColorArrowYPos( int iStepIndex, float fSongBeat )
|
|||||||
|
|
||||||
void Player::SetJudgementX( int iNewX )
|
void Player::SetJudgementX( int iNewX )
|
||||||
{
|
{
|
||||||
m_sprJudgement.SetXY( iNewX, CENTER_Y );
|
m_sprJudgement.SetXY( iNewX, JUDGEMENT_Y );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::UpdateJudgement( const float &fDeltaTime )
|
void Player::UpdateJudgement( const float &fDeltaTime )
|
||||||
@@ -585,10 +596,17 @@ void Player::SetJudgement( StepScore score )
|
|||||||
|
|
||||||
m_fJudgementDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
|
m_fJudgementDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
|
||||||
|
|
||||||
|
if( score == miss ) { // falling down
|
||||||
|
m_sprJudgement.SetY( JUDGEMENT_Y - 30 );
|
||||||
|
m_sprJudgement.SetZoom( 1.0f );
|
||||||
|
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME );
|
||||||
|
m_sprJudgement.SetTweenY( JUDGEMENT_Y + 30 );
|
||||||
|
} else { // zooming out
|
||||||
|
m_sprJudgement.SetY( JUDGEMENT_Y );
|
||||||
m_sprJudgement.SetZoom( 1.5f );
|
m_sprJudgement.SetZoom( 1.5f );
|
||||||
m_sprJudgement.TweenTo( JUDGEMENT_DISPLAY_TIME/3.0,
|
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0 );
|
||||||
m_sprJudgement.GetX(),
|
m_sprJudgement.SetTweenZoom( 1.0f );
|
||||||
m_sprJudgement.GetY() );
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetComboX( int iNewX )
|
void Player::SetComboX( int iNewX )
|
||||||
@@ -756,7 +774,7 @@ void Player::ChangeScore( StepScore score, int iCurCombo )
|
|||||||
case perfect: fScoreToAdd = M * M * 300 + 500; break;
|
case perfect: fScoreToAdd = M * M * 300 + 500; break;
|
||||||
}
|
}
|
||||||
m_fScore += fScoreToAdd;
|
m_fScore += fScoreToAdd;
|
||||||
ASSERT( m_fScore > 0 );
|
ASSERT( m_fScore >= 0 );
|
||||||
|
|
||||||
|
|
||||||
m_ScoreNumber.SetSequence( ssprintf( "%9.0f", m_fScore ) );
|
m_ScoreNumber.SetSequence( ssprintf( "%9.0f", m_fScore ) );
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const int MAX_NUM_COLUMNS = 8;
|
const int MAX_NUM_COLUMNS = 8;
|
||||||
|
|
||||||
|
|
||||||
@@ -49,8 +50,6 @@ protected:
|
|||||||
int m_iMaxCombo;
|
int m_iMaxCombo;
|
||||||
float m_fSongBeat;
|
float m_fSongBeat;
|
||||||
|
|
||||||
enum StepScore{ none, perfect, great, good, boo, miss };
|
|
||||||
enum StepTiming{ no_timing, early, late };
|
|
||||||
// index is quarter beat number (e.g. beat 30 is index 30*4)
|
// index is quarter beat number (e.g. beat 30 is index 30*4)
|
||||||
Step m_OriginalStep[MAX_STEP_ELEMENTS];
|
Step m_OriginalStep[MAX_STEP_ELEMENTS];
|
||||||
Step m_LeftToStepOn[MAX_STEP_ELEMENTS];
|
Step m_LeftToStepOn[MAX_STEP_ELEMENTS];
|
||||||
@@ -72,21 +71,21 @@ protected:
|
|||||||
void UpdateColorArrows( const float& fDeltaTime );
|
void UpdateColorArrows( const float& fDeltaTime );
|
||||||
float GetColorArrowYPos( int iStepIndex, float fSongBeat );
|
float GetColorArrowYPos( int iStepIndex, float fSongBeat );
|
||||||
void DrawColorArrows();
|
void DrawColorArrows();
|
||||||
// Sprite m_sprColorArrow[MAX_NUM_COLUMNS];
|
|
||||||
int m_iColorArrowFrameOffset[MAX_STEP_ELEMENTS];
|
int m_iColorArrowFrameOffset[MAX_STEP_ELEMENTS];
|
||||||
ColorArrow m_ColorArrow[MAX_NUM_COLUMNS];
|
ColorArrow m_ColorArrow[MAX_NUM_COLUMNS];
|
||||||
|
|
||||||
|
|
||||||
// gray arrows
|
// gray arrows
|
||||||
void SetGrayArrowsX( int iX );
|
void SetGrayArrowsX( int iX );
|
||||||
void SetGhostArrowsX( int iX );
|
|
||||||
void UpdateGrayArrows( const float& fDeltaTime );
|
void UpdateGrayArrows( const float& fDeltaTime );
|
||||||
void DrawGrayArrows();
|
void DrawGrayArrows();
|
||||||
void GrayArrowStep( int index );
|
void GrayArrowStep( int index, StepScore score );
|
||||||
void GrayArrowGhostStep( int index );
|
|
||||||
// Sprite m_sprGrayArrow[MAX_NUM_COLUMNS];
|
|
||||||
// Sprite m_sprGrayArrowGhost[MAX_NUM_COLUMNS];
|
|
||||||
GrayArrow m_GrayArrow[MAX_NUM_COLUMNS];
|
GrayArrow m_GrayArrow[MAX_NUM_COLUMNS];
|
||||||
|
|
||||||
|
// ghost arrows
|
||||||
|
void SetGhostArrowsX( int iX );
|
||||||
|
void UpdateGhostArrows( const float& fDeltaTime );
|
||||||
|
void DrawGhostArrows();
|
||||||
|
void GhostArrowStep( int index, StepScore score );
|
||||||
GhostArrow m_GhostArrow[MAX_NUM_COLUMNS];
|
GhostArrow m_GhostArrow[MAX_NUM_COLUMNS];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,9 @@ void Sprite::Draw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
D3DXCOLOR colorDiffuse = m_colorDiffuse;
|
D3DXCOLOR colorDiffuse[4];
|
||||||
|
for(int i=0; i<4; i++)
|
||||||
|
colorDiffuse[i] = m_colorDiffuse[i];
|
||||||
D3DXCOLOR colorAdd = m_colorAdd;
|
D3DXCOLOR colorAdd = m_colorAdd;
|
||||||
|
|
||||||
// update properties based on SpriteEffects
|
// update properties based on SpriteEffects
|
||||||
@@ -209,10 +211,16 @@ void Sprite::Draw()
|
|||||||
case no_effect:
|
case no_effect:
|
||||||
break;
|
break;
|
||||||
case blinking:
|
case blinking:
|
||||||
colorDiffuse = m_bTweeningTowardEndColor ? m_start_colorDiffuse : m_end_colorDiffuse;
|
{
|
||||||
|
for(int i=0; i<4; i++)
|
||||||
|
colorDiffuse[i] = m_bTweeningTowardEndColor ? m_start_colorDiffuse[i] : m_end_colorDiffuse[i];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case camelion:
|
case camelion:
|
||||||
colorDiffuse = m_start_colorDiffuse*m_fPercentBetweenColors + m_end_colorDiffuse*(1.0f-m_fPercentBetweenColors);
|
{
|
||||||
|
for(int i=0; i<4; i++)
|
||||||
|
colorDiffuse[i] = m_start_colorDiffuse[i]*m_fPercentBetweenColors + m_end_colorDiffuse[i]*(1.0f-m_fPercentBetweenColors);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case glowing:
|
case glowing:
|
||||||
colorAdd = m_start_colorAdd*m_fPercentBetweenColors + m_end_colorAdd*(1.0f-m_fPercentBetweenColors);
|
colorAdd = m_start_colorAdd*m_fPercentBetweenColors + m_end_colorAdd*(1.0f-m_fPercentBetweenColors);
|
||||||
@@ -227,7 +235,8 @@ void Sprite::Draw()
|
|||||||
case flickering:
|
case flickering:
|
||||||
m_bVisibleThisFrame = !m_bVisibleThisFrame;
|
m_bVisibleThisFrame = !m_bVisibleThisFrame;
|
||||||
if( !m_bVisibleThisFrame )
|
if( !m_bVisibleThisFrame )
|
||||||
colorDiffuse = D3DXCOLOR(0,0,0,0); // don't draw the frame
|
for(int i=0; i<4; i++)
|
||||||
|
colorDiffuse[i] = D3DXCOLOR(0,0,0,0); // don't draw the frame
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +259,10 @@ void Sprite::Draw()
|
|||||||
v[2].tu = pTexCoordRect->right; v[2].tv = pTexCoordRect->bottom; // bottom right
|
v[2].tu = pTexCoordRect->right; v[2].tv = pTexCoordRect->bottom; // bottom right
|
||||||
v[3].tu = pTexCoordRect->right; v[3].tv = pTexCoordRect->top; // top right
|
v[3].tu = pTexCoordRect->right; v[3].tv = pTexCoordRect->top; // top right
|
||||||
|
|
||||||
v[0].color = v[1].color = v[2].color = v[3].color = colorDiffuse;
|
v[0].color = colorDiffuse[2]; // bottom left
|
||||||
|
v[1].color = colorDiffuse[0]; // top left
|
||||||
|
v[2].color = colorDiffuse[3]; // bottom right
|
||||||
|
v[3].color = colorDiffuse[1]; // top right
|
||||||
|
|
||||||
pVB->Unlock();
|
pVB->Unlock();
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
|||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c
|
# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c
|
||||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
@@ -268,14 +268,6 @@ SOURCE=.\Actor.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\Arrow.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Arrow.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Background.cpp
|
SOURCE=.\Background.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -340,14 +332,6 @@ SOURCE=.\GrayArrow.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\GrayArrows.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\GrayArrows.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\PadInput.h
|
SOURCE=.\PadInput.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
Reference in New Issue
Block a user