Erm they were named correctly, but something went wrong as it said that I already had the header.h file.
So i started a new project and just pasted the code over.
Now the problem is, where should I put my variables that the header file require? Its not a class so I cant put them into a constructor.
Also what should I do with my event? SDL_Event event;
Am I approaching this all wrong? The code was working when it was all in the main.cpp file, but I wanted to make things more organized and it seems to off just broken things lol.
In your CPP file and H files, do a CTRL+F for "background", "screen" and "sprite". You'll see that you haven't defined it anywhere. These need to be of a specific type.
Also, I don't see SDL_Event anywhere in your code. I assume it must be in SDL.h or something, but you don't have SDL_Event event available to your CPP file. I'm surprised you don't have a compiler error for that too. Make sure that you have that somewhere.
Note: It's possible that you have these objects defined in another header file, however unless you use the extern keyword in the header and then re-define it in a cpp file somewhere, it will either not be available to this file, or it will create a compiliation error when you try to include that header twice.