Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// TODO: move the robot in the indicated direction, if possible.
- // If not, robot suffers 1 unit of damage.
- //bool attemptMove(const Arena& a, int dir, int& r, int& c);
- bool success = attemptMove(*m_arena, dir, m_row, m_col);
- if (success == false) {
- m_health = m_health - 1;
- }
- Player* currentPlayer = m_arena->player();
- //if the robot sits on the player, he dead yo
- if (currentPlayer->row() == m_row && currentPlayer->col() == m_col) {
- currentPlayer->setDead();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement