The Student Room Group

can i code this particular game in c/c++?

it's a game for kids to help them learn the names of animals.here the player has to save the animal from a big lion by clicking the correct name from the options given. picture of an animal is hung right above a big lion keepin it's mouth wide open. 3 names of animals are given as options. if the player clicks on the correct option the player has succeeded in saving the animal.

can anyone also provide me what i'll have to do ;just a basic outline

i'll deeply appreciate it if anyone can also suggest me a book related to game coding in c or c++
i learnt c in my first semesteer of computer engineering. this second semester i'm about to learn c++. of course i'll start learning it on my own. but if possible i'd like to make the game in C.
Reply 1
I haven't dealt with C++ yet (Still on the prologue) but I know C and Objective-C so I can only run you down through those paths.

You give the user a set of options and one of those will be incorrect

So: if (user == incorrect)
[Level1 GameOver]
else if (user == correct)
[Level1 Cleared]
else
[Level1 condition]

You gonna have to set the condition of the number of tries the user gets, for (n=1; n<=3:wink: - for 3 turns or less.
I don't know how your GUI will function but the games algorithm seems fairly basic.

My advice is: Learn C++ then apply your skills THEN go into Game Development, the language C++ is not for the faint-hearted - Its quite tough! Games are just fancy UI's, what makes them run is the code (which is under the hood).

The book I currently use is Programming Principles and Practice Using C++ by Bjarne Stroustrup (the creator of the C++ language) then once you done with that book: The C++ Programming Language by Bjarne Stroustrup is the next step.
(edited 10 years ago)
Reply 2
Original post by Grecko
I haven't dealt with C++ yet (Still on the prologue) but I know C and Objective-C so I can only run you down through those paths.

You give the user a set of options and one of those will be incorrect

So: if (user == incorrect)
[Level1 GameOver]
else if (user == correct)
[Level1 Cleared]
else
[Level1 condition]

You gonna have to set the condition of the number of tries the user gets, for (n=1; n<=3:wink: - for 3 turns or less.

thanks for the reply. well, i get how i'll be handling the logics of the program but i'm not familiar with the graphics and use of sound in c programming...

n yes you're right. i guess i must learn c++ first.:smile:
Reply 3
Original post by aachal
thanks for the reply. well, i get how i'll be handling the logics of the program but i'm not familiar with the graphics and use of sound in c programming...

n yes you're right. i guess i must learn c++ first.:smile:


The C language is a bit of a low level language and I have never heard of anyone using it to build games. Most developers use: Python, JavaScript, C#, , C++ or Java {Java, C#, C++ are based from C} to code in because they give you more flexibility e.g. C++ has really extensive classes to use. Call of duty is basically written in C++ but depending on the console, Note that the game had a team of more than 500 people to build so I wouldn't aim that high :wink: and I also read somewhere that the Windows 7 OS (written in C++) took more than 736 developers within 3 years to Dev.

A snippet of what a C++ class might look like:


class X {
private: //the representation (implementation) is private
int m;
public: //the user interface is public
X(int i =0) :m{i} { } // a constructor (initialize the data member m)
int mf(int i) // a member function
{
int old = m;
m = i; // set a new value
return old; // return the old value
}
};
X var {7}; // a variable of type X, initialized to 7
int user(X var, X∗ ptr)
{
int x = var.mf(7); // access using . (dot)
int y = ptr−>mf(9); // access using -> (arrow)
int z = var.m; // error : cannot access private member
}


For graphics rendering and sound, I'd suggest using a game engine.
For example Grand Theft Auto uses Rockstar Advanced Game Engine (RAGE) and Call of Duty uses IW engine and so on...
(edited 10 years ago)
Reply 4
well then you mean c++ is a better option?
java and python would be new to us.
but shall i give java or python a try?
we have been assigned to make an application for our second semester project. our team has thought of making game.
Reply 5
Well if the project specifically requires you to use C++ then stick with what they want.

For C++:

The game engine I would recommend is Blender (It also supports Python) but there are tons of others out there. Go through the Blender tutorials in-order to get better acquainted with the environment.

Now if you want to build a simple 2D game use a game engine which I have grown to love at the moment:

Unity 3D is game engine in which you can port your work to various consoles from IOS to Xbox One to online gaming, the disappointing side of Unity is that you can only code in C# or JavaScript so you gonna have to know one of them. Since C# is based on the C family it wouldn't be that hard for you to get your head around it. C# is also great for Game Development due to its simple coding style.

Well I'm the creative type who would want to build a fantasy world game :colone: but it would take months if not years.

This is what Unity 3D can do!:

Quick Reply

Latest

Trending

Trending