jeffnz Posted November 1, 2017 Report Share Posted November 1, 2017 In the future I'd like to re-write this again and make a full feature game under the GPL-3 license, using proper graphics. https://github.com/jeffkiwi/cplusplus If someone here is really nice then please take a look and tell me what the ugliest part is! I'd ask on gamedev.net but I don't like the spirit of that place, it's about commercial games. I intend to release under GPL, not make money! The games industry is too competitive these days and it's controlled by lawyers and investors. I'm the opposite to them, so I post here So anyway, in my opinion the worst aspect of my program is that there is no error checking. I made an error check before but it didn't behave properly. I used a simple thing: IF(imagebitmap == NULL) THEN CloseProgramGracefully() but for some reason that didn't work and the program crashed with a random return number, instead of a nice error messagebox in SDL2. It was a few weeks ago so I don't remember it very well. I think I tried a try-catch too but I can't remember. I honestly don't know what one to use anyway - try-catch, or if xxxxxxx == NULL? Visual Studio has unit testing but I migrated this project back to Code::Blocks so there's no point in Visual Studio unit tests when they won't work with Code::Blocks. Another problem that I see: my program isn't written according to a "pattern" because I don't know what pattern would suit my program. I doubt that my program needs a pattern. It'd be nice though. When I do an error check and the CloseProgramGracefully() it's nice to be within scope, that way I don't need all the parametres like so: CloseProgramGracefully(graphicsobject, inputobject, soundobject) PLUS delete all block objects, PLUS delete all enemies, PLUS delete all players - another 3 lines each time I wish to close the program, and there are many points where it might need to close due to an error. It's great that I can write in c++ but I'd like to be better at it. I like the teamwork part of programming, but not so much the programming itself lol. I've been doing programming since I was 12 and I made my first game when I was 15. It's the only job I want, yet I feel embarrassed about my ability. ps. If anyone else has a project to share then please do share your program (or your experiences in writing the program). Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted November 2, 2017 Report Share Posted November 2, 2017 Hello @jeffnz! First of all, I shall recommend you to add a Reamde file with a description and instructions how to compile it (i.e., you need SDL to compile). Because currently it's just a set of files. You could add Code::Blocks .cbp files, CMake file or Makefile, any what you want. Also it'd be good to have few screenshots, as you want to share the game. I can suggest to read http://lazyfoo.net/tutorials/SDL/, it's has a good code style enough and basic SDL principles. Also it'd be good to have knowledges about the game architecture at all: http://www.gameenginebook.com/ (on Google Books), or something like that. 3 Quote Link to comment Share on other sites More sharing options...
wraitii Posted November 2, 2017 Report Share Posted November 2, 2017 Quote You could add Code::Blocks .cbp files, CMake file or Makefile, any what you want I find Premake 5 much easier for small projects (for 0 A.D.… Well it's a mess anyway ) 1 Quote Link to comment Share on other sites More sharing options...
jeffnz Posted November 2, 2017 Author Report Share Posted November 2, 2017 @vladislavbelov I have a book titled The Black Art Of Multiplatform Game Programming. That guy uses a pattern but I'm not sure which pattern it is. The later chapters in that book are really confusing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.