Thread: How to put a game together?

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    2

    How to put a game together?

    I have coded a game with graphics and everything that is required, but the problem is i dont know how to put all these files together to make a single program.

    I am currently using code blocks and i have all the source files saved in a folder.

    I would appreciate any help with this as i am relatively new to programming and I dont really understand how to make a program work after it is coded

    Thanks

  2. #2
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    How d'ye mean?

    You want to pack all the picture files in the executable?
    Or are you asking how to compile and link a program?
    Consider this post signed

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    2
    how to pack them all into an executable

  4. #4
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    It largely depends on the system you're using.
    In linux: Embedding a File in an Executable
    (This will likely work in MinGW if you switch out the elf32 flag in objcopy with pe32.)

    (Which means Code::Blocks is fair game)
    Consider this post signed

  5. #5
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    i am curious how you 'coded the graphics and everything' yet none of it is in an executable program. Either you DID code it and its in an executable or at least a library in which case you would not be asking this or you coded nothing.
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  6. #6
    Making mistakes
    Join Date
    Dec 2008
    Posts
    476
    Looking at his last post think he means packing everything (audio, video etc.) into one executable.

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Well that would be a very bad idea in the first place. Data should be kept separate from the executable. The 'graphics' portion should most likely be a DLL or a LIB. The game using the graphics should be the only executable.

    I would pack all data into one binary file but I would not pack it into an executable. To pack it into a binary file in your own format is quite simple. You could preface the file with some basic header information and then use blocks prefaced with a block header for each resource.

    - File header (possible block offset information for random access into the file)
    - Resource block header
    -- Raw data
    - Resource block header
    -- Raw data
    ...
    Last edited by VirtualAce; 05-11-2010 at 05:02 PM.

  8. #8
    Making mistakes
    Join Date
    Dec 2008
    Posts
    476
    Or use tarballs. You don't have to reinvent the wheel if you don't want to (I'd like to do this).

  9. #9
    Registered User
    Join Date
    Dec 2006
    Location
    Scranton, Pa
    Posts
    252
    Bubba's suggestion is the most professional, I'd say. If your game is complex with plenty of needed resources, I'd say go with that & create a loader class to deal with it. Otherwise, if it's just a handful of graphics & a few audio clips, I'd create separate folders for audio & graphics n' load your resources from file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# - Building a SCUMM-like game.. questions
    By Iyouboushi in forum Game Programming
    Replies: 0
    Last Post: 05-24-2008, 10:54 PM
  2. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM
  3. Game Designer vs Game Programmer
    By the dead tree in forum Game Programming
    Replies: 8
    Last Post: 04-28-2005, 09:17 PM
  4. Try my game
    By LuckY in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-15-2004, 11:58 AM
  5. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM