With enough work pushed out today, I shelled out a small prototype script for the game that served as a rudimentary doorway system to load and unload worlds. I used a simple switch statement to load the world using a identifier as a number, and the doorway acting as the trigger to change the value.

Later on I’ll refine the script to use a for loop instead to check the value on each frame, as I feel a switch loop can only go so far until it’s a little too redundant given there are one too many worlds to identify.

void Game::TestWorldTrigger()
{
	switch (worldID) // Check value of worldID
	{
	case 1:
		World1(); //Functions that draw world, depending on worldID value
		break;
	case 2:
		World2();
		break;
	case 3:
		World3();
		break;
	case 4:
		World4();
		break;
	}
}

Continue reading