Thanks a lot for the help! Now it works as intended. As for your suggestion, it's not really anything that's neccesary since this is a personal game that Im making, but I'll think about changing it :)
Type: Posts; User: SimplyEvert
Thanks a lot for the help! Now it works as intended. As for your suggestion, it's not really anything that's neccesary since this is a personal game that Im making, but I'll think about changing it :)
Ok, so I rewrote the erase function so now it looks like this:
std::vector<Entity*>::iterator Container::erase(std::vector<Entity*>::iterator i){
mEntity.erase(i);
return i;
}
It's indeed the line Im refering to that is the right one. But I think I know what the problem is now. I had to make my own erase() function in the container class nad the return type is void. Since...
Error 1 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion)
The error is from the line "i=container.erase(i);" hence the red =
So, I have created my own containerclass that holds a vector. Im using it in a game and when certain objects hits a wall I want them to be erased. Here is the code:
void Game::aliveTest()
{
...
Nvm, I just noticed that Im an idiot......forgot to add ".bmp" to the filename.
Pls ignore this thread :)
So, im trying to create a class which uses a BITMAP*. I don't want to send a BITMAP to the constructor since I want the constructor to load the same image every time. The problem is that when I try...
Hey, Im currently working on a game and I'm trying to get sound working. When I try to play a sound outside of the constructor the program break. Here is the code I've written:
PlayerElme.h ...