Sourcecode suggestion

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Sourcecode suggestion

      HI,

      first of all I have to say, I love your book. Its not so theoretical and brings some flesh to the bones.

      BUT there is a really BIG BUT. After reading your book i got hold of the source code and was very frustrated that this whole code is completely disordered. Everything in the book about "how to order code" and so on is broken :P

      Example:
      struct GameOptions

      you refer in your Game Teapot, but also in the Interface.h and also somewhere else

      but the struct itself is lying in MainLoop/Initialization.h.

      This is only one of many examples i could give. What I suggest for a CodeBase 4.0. PLS tidy your code and, what is more important, could you create code that is reusable, some sort of framework? i have the feeling, everything is split around and i have to pull up "Search for" to find the Information i need from other files in other directories.

      I would like to see: Tepot with all its modified code in one directory and a "framework" directory with all files, one could include to create a game of any kind one likes to build.
      In this framework directory could be the CRandom, the String Class, the HashString Class, the GameLogic Interface, the Gameview,,.... As you described it in your book.

      For my problem: Im coding a 2d dungeon game, and would like to include all i learned from your book. But except of some little code (structs, classes), many things have to be rewritten from scratch, since it is all put together for your demo game (so it seems).

      A more generalistic view would be really cool, even if it would say at the end:

      Source Code

      1. class IGameLogic
      2. {
      3. public:
      4. virtual void VOnUpdate(float time, float elapsedTime)=0;
      5. // put your own code here for GameLogic
      6. };


      It would help building games easier and things easier to understand.

      Just a suggestion and pls forgive my bad english.
    • There are definitely areas for improvement in the code base. The idea was to demonstrate all of the pieces working and functioning together as a single unit, which I think we did pretty well.

      To your specific point, for the most part, all the game-specific code lives in the TeapotWars project while all the engine code lives in the GameCode3 project. You should be able to delete the TeapotWars project entirely and have GameCode3 still build. Thus, the GameCode3 project serves as that framework. The idea is that you'll replace the TeapotWars project with your own. To do this, you'll need to inherit from a few classes, like GameCodeApp, and implement the appropriate virtual functions to get it to work. Check out TeapotWars.h/cpp for examples of how TeapotWars does this.

      Make sense?

      -Rez