Guest User

GameWorld::TankStateEnter()

a guest
Apr 6th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. void GameWorld::TankStateEnter(sf::Vector2f position, AGENTTEAMS team)
  2. {
  3.     Tank* t = new Tank(position);
  4.     t->CreateBody();
  5.     t->team = team;
  6.     if (team == GREEN)
  7.     {
  8.         t->enemyBasePosition = GetRedBasePosition();
  9.     }
  10.     else if (team == RED)
  11.     {
  12.         t->enemyBasePosition = GetGreenBasePosition();
  13.     }
  14.     tanks.push_back(t);
  15.     tankIter = tanks.begin();//this is not very nice, this happens every time a new tank is created
  16.                             //which would create huge problems during runtime - this will be moved!
  17. }
Advertisement
Add Comment
Please, Sign In to add comment