Hello Everyone, I'm trying to write a simple and funny fighting game. I want to write the first class of the game called teacher and i'm not sure if i'm going about it right. I have the moves Punch, Kick, Deafening Whistle, and Textbook Takedown..haha.. don't ask! I also have methods reduceHealth() which controls number of health points. and an accessor method called getHealth(). I want to have four levels with four bad "guys". The problem I'm having is putting it all together in INT MAIN..with a menu do while loop. I'm not sure how to use the methods with the menu and loop..
#include<iostream>
#include<string>
using namespace std;
class teacher{
protected:
int health;
string name;
public:
void showHealth();
void reduceHealth(int damage);
int block(int damage);
int punch();
int kick();
int deafeningWhistle();
int textbookTakedown();
int getHealth();
teacher(int _health, string _name);
~teacher();
};
teacher::teacher(){
health = 200;
name = "Professor Spartan";
}
~teacher(){
}
int teacher::block(int damage){
health = health - damage;
}
int teacher::punch(){
health = health - 10;
}
int teacher::kick(){
health = health - 15;
}
int teacher::defeningWhistle(){
health = health - 25;
}
int teacher::textbookTakedown(){
health = health - 50;
}
class freshman::public teacher{
public:
int sissyslap();
}
freshman::freshman(){
health = 50;
name = "Freshman";
}
~freshman(){
}
int freshman::block(int damage){
health = health - damage;
}
int freshman::sissyslap(){
health = health - 5;
}
class sophomore::public teacher{
public:
int sissykick();
}
sophomore::sophomore(){
health = 75;
name = "Sophomore";
}
~sophomore(){
}
int sophomore::block(int damage){
health = health - damage;
}
int sophomore::sissykick(){
health = health - 5;
}
int sophomore::punch(){
health = health - 10;
}
class junior::public teacher{
public:
int headbutt();
}
junior::junior(){
health = 85;
name = "Junior";
}
~junior(){
}
int junior::block(int damage){
health = health - damage;
}
int junior::headbutt(){
health = health - 20;
}
int junior::punch(){
health = health - 10;
}
int junior::kick(){
health = health - 15;
}
class senior::public teacher(){
public:
int headbutt();
int beercanblitz();
}
senior::senior(){
health = 100;
name = "SuperSeniors!";
}
~senior(){
}
int senior::block(int damage){
health = health - damage;
}
int senior::beercanblitz(){
health = health - 5;
}
int senior::punch(){
health = health - 10;
}
int senior::headbutt(){
health = health - 20;
}
int senior::kick(){
health = health - 15;
}