Advertisement
Guest User

Untitled

a guest
May 31st, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1.     /// TODO:  move the robot in the indicated direction, if possible.
  2.     //        If not, robot suffers 1 unit of damage.
  3.  
  4.     //bool attemptMove(const Arena& a, int dir, int& r, int& c);
  5.     bool success = attemptMove(*m_arena, dir, m_row, m_col);
  6.     if (success == false) {
  7.         m_health = m_health - 1;
  8.     }
  9.  
  10.     Player* currentPlayer = m_arena->player();
  11.  
  12.     //if the robot sits on the player, he dead yo
  13.     if (currentPlayer->row() == m_row && currentPlayer->col() == m_col) {
  14.         currentPlayer->setDead();
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement