Adding the WorldState.h file
Create a new header file in the Header Files/Engine filter called WorldState.h and add the following code:
#pragma once
class WorldState
{
public:
static const int WORLD_WIDTH = 100;
static int WORLD_HEIGHT;
static int SCORE;
static int LIVES;
static int NUM_INVADERS_AT_START;
static int NUM_INVADERS;
static int WAVE_NUMBER;
};
These variables are public and static. As a result, they will be accessible throughout the project and are guaranteed to have only a single instance.