Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

can any one tech me how to make a game ?

+4 votes
asked Sep 22, 2020 by APEX KIDZANIA Nikita gupta (170 points)
reshown Sep 22, 2020 by Admin

4 Answers

+2 votes
answered Sep 22, 2020 by Arpan Ģùptâ (240 points)
yes for sure
+1 vote
answered Sep 22, 2020 by Arpan Ģùptâ (240 points)
depending on what kinda game are you asking for
+5 votes
answered Sep 23, 2020 by Peter Minarik (22,320 points)
edited Sep 23, 2020 by Peter Minarik

Text Based Games

You can create simple, text based games, such as guessing games, mathematical games, word based games etc relatively easily. They can even work here, on OnlineGDB.

Graphics Games

To create a games with graphics, you need way more knowledge and experience as a software developer. The majority of the games you'd buy on Steam or other online platforms have teams of multiple dozen members worked on the creation of the game. For AAA games, the total number of the people who worked on the game can easily reach hundreds (just check the credits and see how long it runs).

Even for a relatively simple, but proper graphics game (e.g. a single player 2D platformer) you'd need to cover the following

  • game logic
  • graphics
  • sound

These are already 3 different segments that need specific knowledge. (And we haven't dealt with 3D object modelling -- luckily we're doing a 2D platformer in this example --, animation, video, physics, multi-player and network programming. We don't have a proper test team either. Also, we haven't dealt with things, like marketing and sales, though this can be somewhat simplified by selling on sites, such as Steam or Epic Games, you name them.)

Use a Game Engine

Most of the time you can pick an existing game engine, such as Unity or Unreal Engine. Alternatively, you may write everything from ground on your own (mostly for smaller games or if you really want to write your own engine.)

Pick a Language (or more?)

You have to also decide what programming language you would like to use.

For graphics games I'd say use C# for Unity or C++ for Unreal Engine. DirectX (for graphics, without using existing engines you need to use DirectX on Windows or OpenGL) has native C++ support and also C# wrapper. Unity also supports C++.

C# is probably easier. C++ gives you more tools and probably better performance. For now, I think this shouldn't be your concern.

For simpler text based games, you can pick either C#, C/C++, Python, Java or anything that can write to the console and read from it so you can have input/output for the user.

For large projects (AAA games), you would probably use multiple languages. E.g. what's best suited to create your game engine or game logic is probably not best suited to script your game events or create the website where you register your game account and can track your progress in-game, etc.

Where To Start?

I'd start with Unity as it has training materials and is probably easier to start with than Unreal Engine (which is probably more powerful and used by more AAA games than Unity).

Also, there are university courses to cover game development. Look around for them in your area.

So yeah, learning how to create games is not easy.

I'd say, start with some text based logic games. Then move on to Unity.

Some Ideas

Tower of Hanoi

For started, you can look at Tower of Hanoi. Create a program that for given number of disks it calculates the minimum number of steps required to take to move all the disks from column A to column C (using column B as a helper).

Number Guessing

Also, if the above sounds way too complicated for starter, you can maybe write a program that tries to guess the number what the user thinks.

E.g. the user has to think a number from 1..100 and the computer can make questions such as

  • is your number less than X?
  • is your number larger than X?
  • is your number X?

Hint, with these set of questions, the computer should be able to guess the right number in 7 guesses. You can make it smart and detect if the user actually lies. :)

If the above is still too complicated, turn it around. The computer thinks of the number and the user makes the (above 3) guesses.

Some Further Ideas

I've list a few more ideas with their target game type (graphics or text base). Sometimes you can simplify them and make some game even text based.

  • count the number of primes until a given number - text based
  • hangman (word guessing) - text based
  • snake (constantly move around on a table) - graphics (text based)
  • mine sweeper (table game) - graphics (text based)
  • a simple text based dungeon crawler (you have an n x m table with every cell having connection to either of the 4 other cells and you can traverse one cell at a time in any available direction. You can find treasures or even monsters. Can you program a little bot to walk this maze and collect the treasures and not to die to monsters?)

Good luck.

0 votes
answered Sep 28, 2020 by Jayden Neifert Reeves (520 points)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.