No, they would have
Player
and
Enemy
classes.
How would I access them at all? Just pass co-ordinates, frame, direciton etc in the argument?
Also, if I have an object declared inside another object, how do I access it's variables / functions?
eg.
1 2 3 4 5 6 7
|
class Player
{
public:
Gun gun();
}
|
Can I just say
player.gun.Shoot();
or do I have to do that in a
player
function:
1 2 3 4
|
void Player::Shoot()
{
gun.shoot();
}
|
____________________________________________________
Also, as before, if I wanted a
Draw
function, separate from any
Graphics
class, and I want to access the same function using different objects:
player.Draw; enemy.Draw;
would I just use inheritance, so that the
Player
and
Enemy
classes are derived from an
Entity
class?