ok im trying to setup my game. first I have my main.cpp which just creates
1 2 3 4
Game game;
game.run();
I also have my Player class but having trouble accessing the player information from the game class. how can I make it so that my game class has access to player class? or any other class for that matter as my game class will be running everything
Player player("Bob");
Game game;
game.run(player);
....
void Game::run(Player& player)
{
player.getStuff();
}
if you have lots of stuff to pass into game, then maybe create a class that holds all the data and pass that in. OR you could create stuff in the game class itself rather than passing in.
ok that works for the game.run(player) function but not for the rest of the functions in the game class, Once im in the game.run() function I have game.update() function as well as others