|
|
|
|
|
|
|
|
|
|
void
Player::move() {
|
|
|
cout
<<“I’ve moved to a new position.” << endl;
|
|
|
}
|
|
|
void
Player::getTreasure() {
|
|
|
health++; // increments health by one
|
|
|
}
|
|
|
int
main() {
|
|
|
Player Jane, John(5, 5);
|
|
|
cout <<“Jane’s health:.” << Jane.health << endl;
|
|
Jane.getTreasure();
|
|
|
cout <<“Jane’s health:.” << Jane.health << endl;
|
|
};
|
|
|
|