...
 
Commits (2)
......@@ -15,19 +15,15 @@ HUD::HUD(sf::RenderWindow& window, HUD::HUD_data* data, HUD::Dir d)
mRoot.attachChild(mContent[i][j]);
switch(d){
case TL :
std::cout << "t1\n";
mContent[i][j]->move(32*j+16,32*i+16);
break;
case TR :
std::cout << "t2\n";
mContent[i][j]->move(mView.getSize().x-32*j-16,32*i+16);
break;
case BL :
std::cout << "t3\n";
mContent[i][j]->move(32*j+16,mView.getSize().y-32*i-16);
break;
case BR :
std::cout << "r4\n";
mContent[i][j]->move(mView.getSize().x-32*j-16,mView.getSize().y-32*i-16);
break;
}
......
......@@ -8,10 +8,9 @@ Game::Game(std::vector<std::string> ips)
for(auto ip : ips) client.push_back(new Client(ip,index++));
mHUD.push_back(new HUD(mWindow,mWorld->getHUDLocator(0), HUD::TL));
index = 1;
for(auto ip : ips){ std::cout << ip << ' ';
for(auto ip : ips){
mHUD.push_back(new HUD(mWindow,mWorld->getHUDLocator(index),
(HUD::Dir)(index % ((int) HUD::Last))));
std::cout << (HUD::Dir)(index % ((int) HUD::Last)) << '\n';
++index;
}
TimePerFrame = sf::seconds(1.f/60.f);
......
......@@ -4,9 +4,12 @@
int main(int argc, char** argv){
if(argc == 1){
std::cout << "Usage : \n\t ./lsv-fighters (<ip1> )* <Seed>\n";
exit(1);
}
srand(atoi(argv[argc-1]));
std::vector<std::string> ips(argv+1,argv+argc-1);
std::cout << argc -3 << '\n';
Game game(ips);
game.run();
return 0;
......