![]() |
The Stroop Test Game
Game Physics with a 2D Physics Engine
|
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. | |
| void | Draw () |
| Draw. | |
| void | Step (eGameState, const Vector2 &) |
| Animation step. | |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon | |
| static b2World * | m_pPhysicsWorld = nullptr |
| Pointer to Box2D Physics World. | |
| static CBox2DRenderer * | m_pRenderer = nullptr |
| Pointer to renderer. | |
| static CObjectManager * | m_pObjectManager = nullptr |
| Pointer to the object manager. | |
| static Sage::CParticleEngine2D * | 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 int | m_nScore = 0 |
| Current score, can be negative. | |
| static int | m_nDelivered = 0 |
| Number of words delivered. | |
| static int | m_nExcellent = 0 |
| Number of words scored as excellent. | |
| static int | m_nGood = 0 |
| Number of words scored as excellent. | |
| static int | m_nFair = 0 |
| Number of words scored as excellent. | |
| static int | m_nFailed = 0 |
| Number of words the player got wrong. | |
| static int | m_nMissed = 0 |
| Number of words the player did not attempt. | |
| static eGameState | m_eGameState = eGameState::Loading |
| Current game state. | |
| static UINT | m_nCntdownNum = 0 |
| The number we are displaying in the countdown. | |
| static CStroop * | m_pStroop = nullptr |
| Pointer to Stroop caricature. | |
| static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| Draw mode. | |
John Ridley Stroop swivels his eyes in a given direction using relaxation to make the swivelling smooth.
| void CStroop::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 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 ) |
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. |

