main() { bool Enigmatic = false; int counter=0; AbstractRoom * currentRoom; AbstractRoom *Start = BuildTheHouse(allRooms); FillTheRooms(allRooms); std::string nothing; Holdall PlayerBag("Linen bag"); PlayerBag.Capacity = 10; PathTest(Start, false, pathOne, 9); std::cout << "Hit <return> to continue: "; getline(std::cin, nothing); ActTest(Start, PlayerBag, ActOne, 31); // Only one action test can be run at a time for now, // since the game state changes and isn't reset. // Simply uncomment the test you want to run. // // ActTest(Start, PlayerBag, ActFour, 10); // ActTest(Start, &PlayerBag, ActTwo, 13); // ActTest(Start, &PlayerBag, ActThree, 13); std::cout << std::endl << "Hit <return> to continue: "; getline(std::cin, nothing); UnitTests(); std::cout << "Hit <return> to continue: "; getline(std::cin, nothing); FunctionPointerTest(); for (int i=0; i < 8; i++) { delete(allRooms[i]); } }
S3E_MAIN_DECL void IwMain() { srand(time(NULL)); GameManager *mgr; mgr = new GameManager(); mgr->SetRequestedFPS(100); mgr->GetResourceManager()->RegisterResourceGroup("images.group"); BUG_HANDLE = mgr->GetResourceManager()->RegisterImage("bug"); SPLAT_HANDLE = mgr->GetResourceManager()->RegisterImage("splat"); LEAVES_HANDLE = mgr->GetResourceManager()->RegisterImage("leaves"); ARROW_HANDLE = mgr->GetResourceManager()->RegisterImage("right_arrow"); FIRE_HANDLE = mgr->GetResourceManager()->RegisterImage("FireBlast"); TREB_FONT_HANDLE = mgr->GetResourceManager()->RegisterFont("trebuchet16pt"); COOPER_FONT_HANDLE = mgr->GetResourceManager()->RegisterFont("cooper_24pt"); GameManager::SetDebugFont(mgr->GetResourceManager()->GetFont(TREB_FONT_HANDLE)); Iw2DSetFont(mgr->GetResourceManager()->GetFont(TREB_FONT_HANDLE)); Sprite *background = new Sprite(mgr); background->SetImage(mgr->GetResourceManager()->GetImage(LEAVES_HANDLE)); background->SetBaseLocation(CIwVec2(0, 0)); background->SetZIndex(-999); mgr->RegisterGameObject(background); int width = mgr->GetSurfaceWidth(); int height = mgr->GetSurfaceHeight(); #define SIMPLE_TEST 0 #define MANY_SHIP_TEST 1 #define ORBITER_TEST 2 #define ANIMATION_TEST 3 #define LABELED_SPRITE 4 #define PATH_TEST 5 int test_selection = SIMPLE_TEST; switch(test_selection) { case SIMPLE_TEST: DoSimpleTest(mgr, ARROW_HANDLE, width, height); break; case MANY_SHIP_TEST: DoManyShipTest(mgr, 10, 10, width, height, ARROW_HANDLE); break; case ORBITER_TEST: MakeOrbiters(mgr, width / 2, height / 2, ARROW_HANDLE); break; case ANIMATION_TEST: AnimationTest(mgr, 0, width, height); break; case LABELED_SPRITE: LabeledSprite(mgr, 0, width, height); break; case PATH_TEST: PathTest(mgr, ARROW_HANDLE, width, height); break; } mgr->MainLoop(); delete mgr; }