Thread: Game w/ Source

  1. #1
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735

    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

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Why do you put function definition in the headers?
    Woop?

  3. #3
    Registered User
    Join Date
    Nov 2004
    Location
    Pennsylvania
    Posts
    434
    Neat, i think its a pretty nifty little game, a bit challenging. Good job! And good luck to you in the future!

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.
    Last edited by VirtualAce; 01-02-2006 at 11:59 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Open-source Game Project
    By Glorfindel in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 03-24-2009, 01:12 AM
  2. PC Game project requires c++ programmers
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 02-22-2006, 12:23 AM
  3. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-26-2006, 12:14 AM
  4. u got me wrong fellas
    By clover in forum Game Programming
    Replies: 4
    Last Post: 10-18-2003, 04:23 PM
  5. My Memory Game
    By jazy921 in forum C Programming
    Replies: 0
    Last Post: 05-05-2003, 05:13 PM