00001 #include "BreakoutLGAlternate.h" 00002 00003 BreakoutLGAlternate::BreakoutLGAlternate() 00004 { 00005 00006 } 00007 00008 BreakoutLGAlternate::~BreakoutLGAlternate() 00009 { 00010 00011 } 00012 00013 BreakoutLevel* BreakoutLGAlternate::GenerateLevel(BreakoutLocationArray *pAvailableLocations, const Vector2i &boxSize, const int &maxHealth) 00014 { 00015 BreakoutLevel* pLevel = new BreakoutLevel(); 00016 00017 for(int y = 0; y < pAvailableLocations->GetHeight(); y++) 00018 { 00019 for(int x = (y % 2); x < pAvailableLocations->GetWidth(); x+=2) 00020 { 00021 int health = static_cast<int>((((float)y / (float)pAvailableLocations->GetHeight()) * (float)maxHealth) + 0.5f); //Round up 00022 Vector2i pos = pAvailableLocations->GetLocation(x,y); 00023 pLevel->push_back(new BreakoutBox(pos, boxSize, health)); 00024 } 00025 } 00026 00027 return pLevel; 00028 }
1.5.9