Game Guides > Game FAQ >  

How do you code a video game

How do you code a video game
This is done in a couple of steps.

First and foremost, you plan out the design for your game. However, since you specifically asked about coding, I'll skip the details on that.

Second, you find a programming language you like and a program that will compile your code for you. If you don't feel like typing out each line of code and would rather let the compiler handle the graphics, there are several great programs available to download specifically made for video-game-creation.
If you do want to know the step-by-step process of making your game from scratch, though, here's what you do:
  1. Look through your game, and decide how to group everything inside: what will the player directly control? What can be put in the background? What objects do I have to make? If you have a lot of similar objects, you can use similar code when making them, saving a lot of excess typing.
  2. Look at everything you just picked out, and decide EXACTLY what each thing will 'do', and how they will interact. For example, a treasure chest: it can be opened/closed, and it can store items as well as release items (its behavior). It should only be openable by a player, who will use their controls to interact with it (interaction/your user interface). Finally, it will need to hold items (it's characteristics)
  3. If you're up to the challenge, open up your compiler, and start coding! (If you're not familiar with coding, I recommend you first learn the language using online resources: there are a lot of great tutorials and examples out there. Be sure not to attempt to monumental a task when you're first learning to code- it can get overwhelming pretty fast. Start simple, practice coding a lot, and work your way towards starting to work on your original game.) Your compiler will handle the code you type in, have the computer run it, and let you know if there are any errors in the code itself.
  4. Finally, when you're done coding the game itself, have friends test it. You'll want to have them do everything they can to "break" your code, so you can find flaws in your code and patch them up.

And that's the basics of how you code your video game!