Hobbies And Interests
Home  >> Games & Cards >> Games

How to Build a Custom Car Computer Game

Games featuring car customization make as their focus the assembly of a car. Such games require a database of different shapes and parts, like the arms and legs for a character-building game, or the buildings and roads of a city simulation (i.e. "sim") game. They must also have rules defining how the player can assemble those parts, and algorithms that define what happens when those parts form a completed car. A key benefit of programming such a game is enhanced programming skill, which you can apply to other, possibly non-game, projects.

Instructions

    • 1

      Download and compile the source code for a city simulation game such as OpenCity or Unknown Horizons.

    • 2

      Play the city sim game, and list on paper the components (e.g. building, roads) it allows players to build cities with.

    • 3

      Write a list of component objects (e.g. tires, engines) that a player can assemble a car from.

    • 4

      Write notes on how the city sim game allows players to fit the components they've chosen to the "chassis" of the city. For example, write answers to questions like, "Where can does the game allow me to place buildings, public works like utility lines, and landscape elements (e.g. trees, terrain), and other structures?" An answer you might write could include, "The city sim game allows players to build parks by dragging and dropping different species of trees (e.g. oak, maple, willow, pine) into a rectangular patch of terrain."

    • 5

      Rewrite the questions you asked in the previous step to relate to your car customization game. For example, "Where on the car's chassis does the game allow players to place the tires, engines and other car parts? How exactly does the player place these parts?" An answer you might write could include the following: "The player can click on different tires from a gallery of tire images, then drag them onto the car's wheel axles."

      Once you have detailed descriptions relating the different components of the car and how they fit to the chassis, you can begin learning the source code for the original game.

    • 6

      Print out the game's source code, then retype, compile, and play the game. This process makes you read the source code carefully, which is a first step in understanding the code.

    • 7

      Delete one of the source code files, then try to retype it from memory. Read the printout for the source file only as needed.

    • 8

      Recompile the game, then repeat the previous step until you no longer need to read the printout.

    • 9

      Delete and learn each remaining source file in the same way as the first. Completing this step will give you an understanding of how the original works sufficient to begin changing the game.

    • 10

      Type source code that replaces the city sim's database of parts with the car parts from Step 3.

    • 11

      Write source that replaces the rules determining how players fit the city parts together, with the rules your wrote in Step 5.

    • 12

      Compile and play the game.


https://www.htfbw.com © Hobbies And Interests