-
Game w/ Source
I made this game with c++ and SDL, it's a vertical shooter and an exe is included in the zip.
I would continue making it, but I need to jumpstart my FPS before Christmas break ends.
If you want to compile yourself, you need these libs
SDLmain.lib sdl.lib SDL_image.lib SDL_mixer.lib SDL_ttf.lib
I'd love any feedback/bugs because I might develop it more later...
Enjoy!
http://www.filelodge.com/files/hdd5/...ep%20Space.zip
-
Why do you put function definition in the headers?
-
Neat, i think its a pretty nifty little game, a bit challenging. Good job! And good luck to you in the future!
-
Crashes on first screen.
After I select a difficulty it dies.
And after looking at the project it's you are using headers completely wrong.
Headers contain declarations such as classes, defines, etc. They only contain code if you make your class functions inline. The globals.h is totally unecessary as well as are the other h files. Try sticking this stuff in classes. If you try to make an FPS like this, you will run into huge problems.
Your structure should be something like this:
CInput.h
class CInput {}
CMouse.h
class CMouse {}
CKeyboard.h
class CKeyboard {}
CGameController.h
class CGameController {}
CSound.h
class CSound {}
CSoundCache.h
Code:
class CSoundCache
{
CSound *m_pSounds;
...
};
CTexture.h
class CTexture {}
CTextureCache.h
Code:
class CTextureCache
{
CTexture *m_pTextures;
...
};
CResourceCache.h
Code:
class CResourceCache
{
CTextureCache *m_pTextureCache;
CSoundCache *m_pSoundCache;
...
};
CEngine.h
Code:
class CEngine
{
CResourceCache *m_pResourceCache;
CInput *m_pInput;
CMouse *m_pMouse;
CKeyboard *m_pKeyboard;
CGameController *m_pGameController;
public:
...
void Render(float fTimeDelta);
};
One way of doing it, but at least it's all modular and object oriented. Each one of these would have a CPP counterpart.
Just a suggestion. But you are not using headers correctly.