// Initialize the game void Purgatory::initialize(HWND hwnd) { Game::initialize(hwnd); // throws GameError // scoreFont.initialize(graphics,25,false,false,"score"); if (!BgTexture.initialize(graphics,"ArtAssets\\Background.png")) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializingbackground")); // if (!PlayerTextures.initialize(graphics,"ArtAssets\\Jeramiah.png")) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing player")); // if (!enemyTexture.initialize(graphics,"pictures\\ghoul.png")) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing ENEMY")); // for(int j=0;j<2;j++) { if (!background[j].initialize(this, BgNS::WIDTH, BgNS::HEIGHT, &BgTexture)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing bg")); } // if (!player1.initialize(this, BumNS::WIDTH, BumNS::HEIGHT, BumNS::TEXTURE_COLS, &PlayerTextures)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing bum")); // for(int i =0;i<3;i++) { if (!enemy[i].initialize(this, BumNS::WIDTH, BumNS::HEIGHT, BumNS::TEXTURE_COLS, &enemyTexture)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing enemy")); enemy[i].setFrames(enemyNS::ENEMY_START_FRAME,enemyNS::ENEMY_END_FRAME); enemy[i].setCurrentFrame(enemyNS::ENEMY_START_FRAME); enemy[i].setColorFilter(SETCOLOR_ARGB(255,255,255,255)); enemy[i].setCollisionType(box); enemy[i].setEdge(ENEMY); enemy[i].setX(650); enemy[i].setY(350); } enemy[0].setVelocity(VECTOR2(0,enemyNS::SPEED1));enemy[1].seteID(1); enemy[1].setVelocity(VECTOR2(0,enemyNS::SPEED2));enemy[2].seteID(2); // player1.setFrames(BumNS::BUM_START_FRAME, BumNS::BUM_END_FRAME); player1.setCurrentFrame(BumNS::BUM_START_FRAME); player1.setColorFilter(SETCOLOR_ARGB(255,255,255,255)); player1.setCollisionType(box); player1.setEdge(PLAYER); // player1.setX(50); player1.setY(350); player1.setVelocity(VECTOR2(BumNS::JUMP_HEIGHT,BumNS::SPEED)); // playerScore=0; background[0].setX(0); background[1].setX(GAME_WIDTH-0); background[0].setY(0); background[1].setY(0); return; }
//============================================================================= // Render game items //============================================================================= void Southfall::render() {// sprite begin and end in game now switch(currentState) { case MAIN_MENU: mainMenu->draw(); break; case INTRO: textbox->draw(); break; case GAME: player->getWorld()->draw(Center(), player->usingMagicSight()); char out[100]; sprintf(out, "Goblins killed: %i", Entity::killCount); gameFont->print(out, 0, 0); if(fontTimer >= 0) { if(fontTimer >= 4) imageLibrary->SouthfallFontIM[fontLoc].draw(SETCOLOR_ARGB(int((6-fontTimer)*80),255,255,255)); else if(fontTimer < 2) imageLibrary->SouthfallFontIM[fontLoc].draw(SETCOLOR_ARGB(int(fontTimer*80),255,255,255)); else imageLibrary->SouthfallFontIM[fontLoc].draw(SETCOLOR_ARGB(160,255,255,255)); fontTimer -= frameTime; } break; case BIRMINGHAMSTATE: renderBirmingham(); break; case ACTIONMENU: player->getWorld()->draw(Center(), player->usingMagicSight()); actionMenu->draw(); break; case OPENTEXTBOX: player->getWorld()->draw(Center(), player->usingMagicSight()); textbox->draw(); break; case GAME_OVER: Image* temp; if (Interface->getMain()->winCondition()) temp = &imageLibrary->WinIM; else temp = &imageLibrary->DeadIM; temp->setX(SCREEN_WIDTH/2 - temp->getWidth()/2); temp->setY(SCREEN_HEIGHT/2 - temp->getHeight()/2); temp->draw(); //if (input->anyKeyPressed()) done = true; break; } }
HUD::HUD(Graphics*& g) { graphics = g; itemTexture = new TextureManager(); gunHUDTexture = new TextureManager(); hpHUDTexture = new TextureManager(); hpTexture = new TextureManager(); //Load and set up hp HUD texture if (!hpHUDTexture->initialize(graphics, TEXTURE_HUD_HP)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing hp hud texture")); hpHUD = new Image(); hpHUD->initialize(graphics, hudNS::HP_HUD_WIDTH, hudNS::HP_HUD_HEIGHT, 1, hpHUDTexture); hpHUD->setCurrentFrame(0); hpHUD->setX(50); hpHUD->setY(60); if (!hpTexture->initialize(graphics, TEXTURE_HUD_HP_RED)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing hp texture")); hp = new Image(); hp->initialize(graphics, hudNS::HP_WIDTH, hudNS::HP_HEIGHT, 1, hpTexture); hp->setCurrentFrame(0); hp->setX(hpHUD->getX() + 30); hp->setY(hpHUD->getY()); //Load and set up gun HUD texture if (!gunHUDTexture->initialize(graphics, TEXTURE_HUD_GUN)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing gun hud texture")); gunHud = new Image(); gunHud->initialize(graphics, hudNS::GUN_HUD_WIDTH, hudNS::GUN_HUD_HEIGHT, 1, gunHUDTexture); gunHud->setCurrentFrame(0); gunHud->setX(hpHUD->getX() + hpHUD->getWidth() + 50); gunHud->setY(50); //Load and set up item HUD texture if (!itemTexture->initialize(graphics, TEXTURE_GUNS)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing gun texture")); currentItemImage = new Image(); currentItemImage->initialize(graphics, gunNS::TEXTURE_WIDTH, gunNS::TEXTURE_HEIGHT, gunNS::TEXTURE_COLS, itemTexture); currentItemImage->setX(gunHud->getX()); currentItemImage->setY(gunHud->getY() + 10); currentItemImage->setScale(0.8); //Load and set up Points HUD texture pointHud = new Image(); pointHud->initialize(graphics, hudNS::GUN_HUD_WIDTH, hudNS::GUN_HUD_HEIGHT, 1, gunHUDTexture); pointHud->setCurrentFrame(0); pointHud->setX(gunHud->getX() + gunHud->getWidth() + 50); pointHud->setY(50); //set up font ammoFont = new TextDX(); ammoFont->initialize(graphics, 20, false, false, "Courier New"); ammoFont->setFontColor(SETCOLOR_ARGB(192, 0, 0, 0)); currentItem = nullptr; currentPlayer = nullptr; }
//============================================================================= // Constructor //============================================================================= Graphics::Graphics() { direct3d = NULL; device3d = NULL; fullscreen = false; width = GAME_WIDTH; // width & height are replaced in initialize() height = GAME_HEIGHT; backColor = SETCOLOR_ARGB(255, 0, 0, 128); // dark blue gameScale = 1; camera = D3DXVECTOR2(0,(float) GAME_HEIGHT); }
//============================================================================= // default constructor //============================================================================= TextDX::TextDX() { color = SETCOLOR_ARGB(255,255,255,255); // default to white font // set font position fontRect.top = 0; fontRect.left = 0; fontRect.right = GAME_WIDTH; fontRect.bottom = GAME_HEIGHT; dxFont = NULL; angle = 0; }
//============================================================================= // Initializes the game // Throws GameError on error //============================================================================= void MessageDemo::initialize(HWND hwnd) { Game::initialize(hwnd); // throws GameError reset(); // reset all game variables fpsOn = true; // display frames per second messageDialog->setBorderColor(graphicsNS::LTGRAY); messageDialog->setBackColor(SETCOLOR_ARGB(255,50,50,90)); messageDialog->print("This is a test message. This is only a test. If this " "were an actual message it would contain some useful " "information instead of this meaningless dribble."); }
//============================================================================= // Initializes the game // Throws GameError on error //============================================================================= void InputDialogDemo::initialize(HWND hwnd) { Game::initialize(hwnd); // throws GameError reset(); // reset all game variables fpsOn = true; // display frames per second // Initialize InputDialog inputDialog = new InputDialog(); inputDialog->initialize(graphics, input, hwnd); inputDialog->setBorderColor(graphicsNS::LTGRAY); inputDialog->setBackColor(SETCOLOR_ARGB(255,50,50,90)); inputDialog->print("Input Dialog Demo.\nType text then press 'Enter' to " "complete.\nType just the word 'next' for a surprise."); }
//============================================================================= // Initializes the game // Throws GameError on error //============================================================================= void Spacewar::initialize(HWND hwnd) { Game::initialize(hwnd); // throws GameError // initialize DirectX fonts fontBig.initialize(graphics, spacewarNS::FONT_BIG_SIZE, false, false, spacewarNS::FONT); fontBig.setFontColor(spacewarNS::FONT_COLOR); // menu texture if (!menuTexture.initialize(graphics,MENU_IMAGE)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing menu texture")); // space texture if (!spaceTexture.initialize(graphics,SPACE_IMAGE)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing space texture")); // game textures if (!textures1.initialize(graphics,TEXTURES1_IMAGE)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing game textures")); // menu image if (!menu.initialize(graphics,0,0,0,&menuTexture)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing menu")); // space image if (!space.initialize(graphics,0,0,0,&spaceTexture)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing space")); space.setScale((float)SPACE_SCALE); // ship1 if (!ship1.initialize(this,shipNS::WIDTH,shipNS::HEIGHT,shipNS::TEXTURE_COLS,&textures1)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing ship1")); ship1.setFrames(shipNS::SHIP1_START_FRAME, shipNS::SHIP1_END_FRAME); ship1.setCurrentFrame(shipNS::SHIP1_START_FRAME); ship1.setColorFilter(SETCOLOR_ARGB(255,230,230,255)); // light blue, used for shield and torpedo ship1.setMass(shipNS::MASS); // Start ship in center ship1.setX(GAME_WIDTH/2 - shipNS::WIDTH); ship1.setY(GAME_HEIGHT/2 - shipNS::HEIGHT); }
bool Player::initialize(Game *gamePtr, int width, int height, int ncols, TextureManager *textureM) { bool retVal = Entity::initialize(gamePtr, width, height, ncols, textureM); //Initialize the mirror texture if (!this->mirrorTexture.initialize(this->graphics, TURRET_MIRROR)) throw GameError(gameErrorNS::FATAL_ERROR, "Error initializing the player turret mirror texture"); //Initialize the turret texture if (!this->turretTexture.initialize(this->graphics, TURRET)) throw GameError(gameErrorNS::FATAL_ERROR, "Error initializing the player turret texture"); //Initialize the mirror object if (!this->mirror.initialize(gamePtr, playerMirrorNS::WIDTH, playerMirrorNS::HEIGHT, 1, &this->mirrorTexture)) throw GameError(gameErrorNS::FATAL_ERROR, "Error initializing the player turret mirror object"); //Initialize the turret object if (!this->turret.initialize(gamePtr, playerTurretNS::WIDTH, playerTurretNS::HEIGHT, 1, &this->turretTexture)) throw GameError(gameErrorNS::FATAL_ERROR, "Error initializing the player turret object"); turret.setColor(SETCOLOR_ARGB(255,152,254,178)); return retVal; }
//============================================================================= // Initializes the game // Throws GameError on error //============================================================================= void Grpg::initialize(HWND hwnd) { Game::initialize(hwnd); // throws GameError /* initialize random seed: */ srand(time(NULL)); Skill::setupAllSkills(); mapLoader->loadData(); // Set viewport viewport->setX(startLocation.x); viewport->setY(startLocation.y); // Load data itemLoader = new ItemLoader(); itemLoader->loadAllItems(); personLoader->loadAllNPCs(itemLoader);//ml free riftData = new RiftData(); riftData->loadData(); missSplat = new TextureManager(); missSplat->initialize(graphics, MISS_IMAGE); entityNS::miss.initialize(graphics, 0, 0, 0, missSplat); hitSplat = new TextureManager(); hitSplat->initialize(graphics, HIT_IMAGE); entityNS::hit.initialize(graphics, 0, 0, 0, hitSplat); if (!dragonfireTexture->initialize(graphics, aidilNS::dragonfireLocation)) { throw new GameError(gameErrorNS::FATAL_ERROR, "Failed to initialize dragonfire texture."); } entityNS::splatText.initialize(graphics, 12, false, false, "Arial"); entityNS::splatText.setFontColor(SETCOLOR_ARGB(255, 255, 255, 255)); entityNS::messageFont.initialize(graphics, 20, true, false, "Arial"); entityNS::messageFont.setFontColor(SETCOLOR_ARGB(255, 255, 255, 255)); //Setup a generic YES/NO decision chatNS::YESNO = ChatDecision(chatNS::HORIZONTALLY); ChatOption cp, cp2; cp.id = 1; cp.text = "Yes"; cp2.id = 2; cp2.text = "No"; chatNS::YESNO.addOption(cp); chatNS::YESNO.addOption(cp2); // initialize DirectX fonts // 15 pixel high Arial if (uiFont->initialize(graphics, 20, true, false, "Arial") == false) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing UI Font")); //ml free // Initialise entities player = new Player(); ui = new UI(); if(!player->initialize(this)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initalizing the player")); if (!ui->initialize(this, player, input)) throw(GameError(gameErrorNS::FATAL_ERROR, "Error initalizing the user interface")); ui->setX(uiNS::X); ui->setY(uiNS::Y); player->setInventory(new Inventory()); //Init position of inventory inside inventory to init positioning of inventory items upon their adding into them player->getInventory()->setXDrawPosition(ui->getTopLeftX()); player->getInventory()->setYDrawPosition(ui->getTopLeftY()); //Quest buttons need the getTopLeftX and Y questLoader = new QuestLoader(); gameEventManager = new GameEventManager(ui, questLoader->getQuestData()); questLoader->loadAllQuests(gameEventManager, personLoader, itemLoader, graphics, ui->getTopLeftX(), ui->getTopLeftY()); drawManager->addObject(player,3); drawManager->addObject(ui, 999); // Load and display map, start spawners mapLoader->setVictim(player); mapLoader->loadMap(); player->setX(startLocation.x); player->setY(startLocation.y); leftMouseWasDown = input->getMouseLButton(); rightMouseWasDown = input->getMouseRButton(); /* InventoryItem* y = new InventoryItem(itemLoader->getItem(0), 9); Entity* e = new Entity(); e->initialize(this, y, true);//anchored if its an inventory //y->initialize(this, true); player->getInventory()->addEntityInventoryItem(e); //ml free //Object test //CRIME SCENE *//* InventoryItem* x = new InventoryItem(itemLoader->getItem(0), 9900); Entity* newObj = new Entity(); newObj->initialize(this, x, false); //x->initialize(this, false); newObj->setX(startLocation.x); newObj->setY(startLocation.y); drawManager->addObject(newObj, 2);*/ /* InventoryItem* f = new InventoryItem(itemLoader->getItem(7), 1); newObj = new Entity(); newObj->initialize(this, f, false); //x->initialize(this, false); newObj->setX(startLocation.x); newObj->setY(startLocation.y); drawManager->addObject(newObj, 2); f = new InventoryItem(itemLoader->getItem(8), 1); newObj = new Entity(); newObj->initialize(this, f, false); //x->initialize(this, false); newObj->setX(startLocation.x); newObj->setY(startLocation.y); drawManager->addObject(newObj, 2); */ //END SCENE //Play music SoundManager::initialize(); SoundManager::playMusic(soundManagerNS::generalMusicID); analyticsDelay = GrpgNS::startingAnalyticsDelay; return; }
//============================================================================= // Initializes the game // Throws GameError on error //============================================================================= void Southfall::initialize(HWND hwnd) { Game::initialize(hwnd); currentState = MAIN_MENU; pause = false; firstTimeBattle = true; Entity::killCount = 0; done = false; // Graphics graphics = new Graphics(); graphics->initialize(hwnd, SCREEN_WIDTH, SCREEN_HEIGHT, FULLSCREEN); //NPC::initGraphics(graphics); imageLibrary = new ImageLibrary(graphics); // Menu mainMenu = new Menu(); mainMenu->initialize(graphics, input); actionMenu = new GameMenu(); actionMenu->initialize(graphics, input, "Available Actions:"); // Font gameFont = new TextDX(); gameFont->initialize(graphics, 40, false, false, "Andalus"); gameFont->setFontColor(SETCOLOR_ARGB(255,255,255,255)); //Initialize global TextBox textbox = new TextBox(gameFont, audio, input, &imageLibrary->TextBoxIM, &imageLibrary->TextBoxArrowIM); textbox->setActive(false); // WorldInterface Interface = new WorldInterface(imageLibrary); Interface->initialize(graphics, audio, textbox); // Initialized Player here, have center point at player's position player = new Hero(ZERO, heroNS::HERO_RADIUS, &imageLibrary->Character1IM, input, audio, textbox, new Drawable(&imageLibrary->SwingingSwordIM)); //places player right by first goblin //player->setPosition(VECTOR2(112.5,60.5)); //places player by house in Southfall //player->setPosition(VECTOR2(102.5,96.5)); //places player on chair in Bar player->setPosition(VECTOR2(11.5,7)); player->setWorld(Interface->getCurrent()); player->getWorld()->addEntity(player); player->setSpellType(NULLTYPE); birm = new Birmingham(audio, &imageLibrary->BirmSpriteIM); birm->setPosition(VECTOR2(113,101.5)); birm->setController(new StationaryAI(birm)); fontLoc = 0; fontTimer = 6; // For testing: set up action Menu: /*actionMenu->addButton(new Button("Sword", &imageLibrary->SwordIconIM, 0)); actionMenu->addButton(new Button("Impede Spell", &imageLibrary->ImpedeEffectIM, 1)); actionMenu->addButton(new Button("Quick Portal", &imageLibrary->PortalOpenIM, 2)); actionMenu->addButton(new Button("Blink", &imageLibrary->BlinkIconIM, 3)); actionMenu->addButton(new Button("Fireball", &imageLibrary->FireballIconIM, 4)); actionMenu->addButton(new Button("Shadowball", &imageLibrary->ShadowballIconIM, 5)); actionMenu->addButton(new Button("Magic Sight On", &imageLibrary->MagicSightOnIM, 8)); actionMenu->addButton(new Button("Magic Sight Off", &imageLibrary->MagicSightOffIM, 9)); */ }
void Level::initialize(ValeGame *gamePtr) { gamePointer = gamePtr; graphics = gamePtr->getGraphics(); input = gamePtr->getInput(); srand(time(NULL)); //fonts quickCD.initialize(graphics, hudNS::COOLDOWN_SIZE, false, false, hudNS::FONT); quickCD.setFontColor(hudNS::FONT_COLOR); focusCD.initialize(graphics, hudNS::COOLDOWN_SIZE, false, false, hudNS::FONT); focusCD.setFontColor(hudNS::FONT_COLOR); fleetfeetCD.initialize(graphics, hudNS::COOLDOWN_SIZE, false, false, hudNS::FONT); fleetfeetCD.setFontColor(hudNS::FONT_COLOR); scoreText.initialize(graphics, 64, false, false, hudNS::FONT); scoreText.setFontColor(SETCOLOR_ARGB(255, 78, 162, 241)); //textures wardenTexture.initialize(graphics, WARDEN_IMAGE); projectileTextures.initialize(graphics, PROJECTILE_IMAGE); focusBarFillTexture.initialize(graphics, FOCUS_BAR_FILL); focusBarBGTexture.initialize(graphics, FOCUS_BAR_BG); focusBarBGMuseTexture.initialize(graphics, FOCUS_BAR_BG_MUSE); heartHUDTexture.initialize(graphics, HEART_HUD); heartTexture.initialize(graphics, HEART_ICON); spawnPointTexture.initialize(graphics,SPAWNER_IMAGE); //ability textures for(int i = 0; i < wardenNS::NUM_BOWS; i++) { bowTexture[i].initialize(graphics, BOW_ICON[i]); quickShotAbilityTexture[i].initialize(graphics, QUICKSHOT_ICON[i]); focusShotAbilityTexture[i].initialize(graphics, FOCUSSHOT_ICON[i]); } fleetFeetAbilityTexture.initialize(graphics, FLEETFEET_ICON); // Collision detection // Compute grid dimensions from the map size divided by grid dimension size float dX = (float)((width * tileSize)/GRID_CELL_DIMENSIONS); gridW = (int)ceil(dX); float dY = (float)((height * tileSize)/GRID_CELL_DIMENSIONS); gridH = (int)ceil(dY); // Instantiate the grid collision = cGrid(gridW, gridH, GRID_CELL_DIMENSIONS, &score); //particle system bs ps.initialize(graphics, L"..\\..\\Textures\\Particles\\smoke_hardedge.tga"); ps.setEmitterShape(EMITTER_SHAPE_NONE); ps.setEmitterType(EMITTER_TYPE_DEFAULT); D3DXVECTOR2 tempPos(-100.0f, -100.0f); ps.setPosition(tempPos); particleSystems.resize(5); for(int i = 0; i < 5; i++) { particleSystems[i].initialize(graphics, L"..\\..\\Textures\\Particles\\smoke_hardedge.tga"); particleSystems[i].setEmitterShape(EMITTER_SHAPE_NONE); particleSystems[i].setEmitterType(EMITTER_TYPE_DEFAULT); D3DXVECTOR2 tempPos(-100.0f, -100.0f); particleSystems[i].setPosition(tempPos); } lastUsedParticleSystem = 4; //warden warden.initialize(gamePtr, 32, 32, 1, &wardenTexture, &projectileTextures, &projectileTextures); D3DXVECTOR2 tmp(hudNS::SPAWN_X, hudNS::SPAWN_Y); warden.setPosition(tmp); score = 0; //Enemies risenManager.init(&score); risenSpawner.initialize(gamePtr,32,32,1,&spawnPointTexture,&risenManager.risen,&warden,tiles); risenSpawner.setPosition(tmp); addTimedSpawn(gamePtr,Risen::WAR,30.0,D3DXVECTOR2(2000.0f,1500.0f),400000); std::vector<Risen::types> hello1; std::vector<int> hello2; hello1.push_back(Risen::WARLOCK); hello1.push_back(Risen::ARCHER); hello1.push_back(Risen::HOUND); hello2.push_back(2); hello2.push_back(3); hello2.push_back(1); addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(750.0f,3200.0f),400000); hello1.clear(); hello2.clear(); hello1.push_back(Risen::HOUND); hello2.push_back(1); addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(1500.0f,2750.0f),400000); hello1.clear(); hello2.clear(); hello1.push_back(Risen::WAR); hello1.push_back(Risen::ARCHER); hello2.push_back(1); hello2.push_back(1); addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(3300.0f,1000.0f),300000); hello1.clear(); hello2.clear(); hello1.push_back(Risen::WAR); hello2.push_back(1); addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(2350.0f,785.0f),320000); hello2[0] = 2; addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(2430.0f,175.0f),120000); hello1.push_back(Risen::WARLOCK); hello2.push_back(1); hello2[0] = 1; addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(3650.0f,1900.0f),250000); addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(3700.0f,2000.0f),200000); hello1[1] = Risen::WAR; addStaticSpawn(gamePtr,hello1,hello2,D3DXVECTOR2(3700.0f,1800.0f),250000); //equipment addBow(20, 2, SPLIT); addBow(19, 21, MUSE); //Hud scoreRect.left = 50.0f; scoreRect.top = 50.0f; scoreRect.bottom = 150.0f; scoreRect.right = 250.0f; //focus bar focusBarFill.initialize(graphics, &focusBarFillTexture, 128, 128, 0, 0, 1.0f, graphicsNS::WHITE); focusBarBG.initialize(graphics,128, 128, 1, &focusBarBGTexture); focusBarBGMuse.initialize(graphics, 128, 128, 1, &focusBarBGMuseTexture); for(int i = 0; i < 4; i++) { heartHUD[i].initialize(graphics, 32, 32, 1, &heartHUDTexture); heartHUD[i].setX(hudNS::HEART_X + i*32); heartHUD[i].setY(hudNS::HEART_Y); } //abilities for(int i = 0; i < wardenNS::NUM_BOWS; i++) { quickShotAbility[i].initialize(graphics, hudNS::ABILITY_ICON_SIZE, hudNS::ABILITY_ICON_SIZE, 1, &quickShotAbilityTexture[i]); quickShotAbility[i].setX(hudNS::QUICK_ICON_X); quickShotAbility[i].setY(hudNS::ABILITY_ICON_Y); focusShotAbility[i].initialize(graphics, hudNS::ABILITY_ICON_SIZE, hudNS::ABILITY_ICON_SIZE, 1, &focusShotAbilityTexture[i]); focusShotAbility[i].setX(hudNS::FOCUS_ICON_X); focusShotAbility[i].setY(hudNS::ABILITY_ICON_Y); } fleetFeetAbility.initialize(graphics, hudNS::ABILITY_ICON_SIZE, hudNS::ABILITY_ICON_SIZE, 1, &fleetFeetAbilityTexture); fleetFeetAbility.setX(hudNS::FLEET_ICON_X); fleetFeetAbility.setY(hudNS::ABILITY_ICON_Y); }