![]() |
The Stroop Test Game
Ian Parberry's "Introduction to Game Physics"
|
A caricature of John Ridley Stroop with swivelling eyeballs. More...
#include <Stroop.h>
Public Member Functions | |
CStroop () | |
Constructor. | |
void | SetDesiredEyePos (const Vector2 &, float) |
Set desired eye position. More... | |
void | Draw () |
Draw. More... | |
void | Step (eGameState, const Vector2 &) |
Animation step. More... | |
Private Attributes | |
Vector2 | m_vPos |
Face position. | |
Vector2 | m_vCurEyePos |
Current eye position. | |
Vector2 | m_vDesiredEyePos |
Desired eye position. | |
Vector2 | m_vNeutralEyePos |
Neutral eye position. | |
float | m_fTwitchDelay = 0.0f |
Eye twitch delay. | |
float | m_fEyeSpeed = 0.0f |
Eye swivelling speed. | |
Additional Inherited Members | |
![]() | |
static b2World * | m_pPhysicsWorld = nullptr |
Pointer to Box2D Physics World. | |
static CRenderer * | m_pRenderer = nullptr |
Pointer to the Renderer. | |
static CObjectManager * | m_pObjectManager = nullptr |
Pointer to the Object Manager. | |
static LParticleEngine2D * | m_pParticleEngine = nullptr |
Pointer to particle engine. | |
static CVectorField * | m_pVectorField = nullptr |
Pointer to a vector field. | |
static CBubbleEngine * | m_pBubbleEngine = nullptr |
Pointer to a bubble engine. | |
static bool | m_bDrawVectors = false |
Do we draw the vector field? | |
static bool | m_bDrawPressure = false |
Do we draw the pressures from the vector field? | |
static bool | m_bDrawPoints = false |
Do we draw the points from the vector field? | |
static bool | m_bDrawParticles = true |
Do we draw particles? | |
static eWordColor | m_eCurColor = eWordColor::Black |
Color of the current word. | |
static bool | m_bTried = false |
Whether the player has tried on the current word. | |
static UINT | m_nWordCnt = INITIAL_WORDCOUNT |
Number of words. | |
static UINT | m_nScore = 0 |
Current score, can be negatice. | |
static UINT | m_nDelivered = 0 |
Number of words delivered. | |
static UINT | m_nExcellent = 0 |
Number of words scored as excellent. | |
static UINT | m_nGood = 0 |
Number of words scored as excellent. | |
static UINT | m_nFair = 0 |
Number of words scored as excellent. | |
static UINT | m_nFailed = 0 |
Number of words the player got wrong. | |
static UINT | m_nMissed = 0 |
Number of words the player did not attempt. | |
static eGameState | m_eGameState = eGameState::Instructions |
Current game state. | |
static UINT | m_nCntdownNum = 0 |
The number we are displaying in the countdown. | |
A caricature of John Ridley Stroop with swivelling eyeballs.
John Ridley Stroop swivels his eyes in a given direction using relaxation to make the swivelling smooth.
void CStroop::Draw | ( | ) |
Draw.
Draw JRS with his eyeballs drawn before his irises drawn before his face so that everything looks right.
void CStroop::SetDesiredEyePos | ( | const Vector2 & | v, |
float | m | ||
) |
Set desired eye position.
Set the eye offset in a particular direction.
v | Look-at point. |
m | Magnitude of eyeball offset in the gaze direction |
void CStroop::Step | ( | eGameState | state, |
const Vector2 & | v | ||
) |
Animation step.
Perform an animation step. Stroop's gaze will shift to a new direction depending on game state. During the countdown it will swivel to the center of the windoe, diregarding the gaze parameter v. When playing it will swivel towards v unless v is the zero vector, in which case it will swivel towards the neutral gaze, which is straight forwards. In the beginning game state his eyes will twitch pseudorandomly. In the scoring state his eyes will swivel downwards towards where the total score is displayed in the score bar.
state | Current game state. |
v | Gaze direction. |