Ok, I am a bit confused. How do I make a derived class from this:
I think it is something like:Code:#include <iostream> class Enemy { public: int enemyHealth; int attack(); }; int Enemy::attack() { int hit; srand(time(NULL)); hit = rand() % 6 + 5; return hit; }
Also, how do i change the method, or do I have to write a new one for this class?Code:class Joker : public Enemy { // I know that everything thats public in Enemy is in Joker automatically. };