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.