I have a class called Rock and I'm passing in my player class.
Rock::Rock(Player& player){
_rock.setTexture(_rockTexture);
_rock.setOrigin(650,500);
_rock.setPosition(X, Y);
_player = &player;
}
In my Game glass, which is the game engine, I get an error
Game::Game():
_window(sf::VideoMode(WIDTH, HEIGHT), "ROCK"){
}
Error: no function to call Rock::Rock()
I assume this is because rock is taking a parameter.
But in Game:Game, how am I supposed to define something here to satisfy this error?
I tried making the Rock object in Game a pointer by that crashes the program.
If I had to pass any argument into the Rock constructor, how do I satisfy it in the Game class?