It's been a little while since I last came here.
I've followed many interesting tutorials and made simple games, like tetris and snake... anyways.
I've started to make a small project I hope to get some money with
as I need to eat too.
But well after few hours of coding I run into some problems. I'll start with easier one.
For some reason I cannot store a value within a function, what I mean is I want to do something like this:
Main Class:
// Main
int main()
{
// Create the main window
RenderWindow app(VideoMode(256, 160), "coolgame");
while (app.isOpen())
{
Event event;
while (app.pollEvent(event))
{
if (event.type == sf::Event::Closed)
app.close();
}
DrawingClass()::Draw(app);
}
return 0;
}
and here would be the drawing class
DrawingClass::Draw(RenderWindow window)
{
// Clear screen
window.clear();
// Draw the sprite
window.draw(cutie);
// Update the window
window.display();
}
I get an error:
no match for call to '(sf::Sprite) ()'
So uhh.... how do I make this work?
Other thing when I try to work with enums to change the game state, I.E. playing or menu, I don't really make it work out nice. I've searched several tutorials and all that but nope.
What I want to do each time I switch states. I want to load data and unload data I won't use.
Save specific data in a file and then read the data from the file for next state or when person wants to play the game other time, well like high score I want to save.
Right now that's all I can think off what to say.
Thank you for your help!