// Character.cpp implementation for the calss Character.cpp #include "Character.h" // return character x position int Character::GetX() { return x; } // return character y position int Character::GetY() { return y; } // assign character x position void Character::SetX(int newx) { x = newx; } // assign character y position void Character::SetY(int newy) { y = newy; } // draw the character void Character::Draw(GP142Display &display) { display.drawCircle(CaveX + (CaveSize*x) - CaveSize/2, CaveY + (CaveSize*y) - CaveSize/2, CharSize/2, Blue); } // draws of the character dot withe another dot void Character::DrawOVER(GP142Display &display) { display.drawCircle(CaveX + (CaveSize*x) - CaveSize/2, CaveY + (CaveSize*y) - CaveSize/2, CharSize/2, White); display.drawCircle(CaveX + (CaveSize*x) - CaveSize/2, CaveY + (CaveSize*y) - CaveSize/2, CharSize/3.5, NavyBlue); } // move the character by updating x, y values void Character::MoveUp(){ if(y < MaxCave-1) y= y+1; } void Character::MoveDown(){ if( y > 0) y = y-1; } void Character::MoveLeft(){ if(x > 0) x= x-1; } void Character::MoveRight(){ if(x < MaxCave-1) x=x+1; }