Object orientation is the part of c# used for games?

Asked

Viewed 440 times

-9

That there are differences between the c# language for form programming and for other areas, I know, but I have a question: Is the object orientation the part used for game programming? If not: What is the purpose of Object Orientation?

  • 3

    https://pt.wikipedia.org/wiki/Orienta%C3%A7%C3%A3o_a_objetos

  • 4

    Write games in machine language, pure C, C#, Java and even in sed. What is used of a programming language to make games is its ability to solve problems. In this case, Unity chose to use C# as one of its programming languages, along with Javascript. The use of C# in Unity was a choice to facilitate the reuse of solutions and also the part relating to extending a solution to a specific purpose. Object orientation makes these reuses more evident

2 answers

8


Ask yourself that question:

What defines something like a game?

Programming languages, being based on object orientation, procedures or other possible types do not define the quality needed to create a game.

There are several types of games:

  1. question games, which would simply type a text or number into a input (RPG-style text games usually look like this)
  2. 2d platform games
  3. Miscellaneous 3d games

But what defined them as games?

From my point of view is user interaction (and the type of interaction), so a programming language can create something used graphic resources and nay necessarily be a game, but rather an animation that tells a story based on the movement of graphic elements, ie it would be a small movie.

Now speaking only of the graphical part, even with the combination of ++ you can create a small game (or even a big one), it is not the language that is aimed at creating games, it is the "resources" that you have available, for example, in the past there were no platforms, advanced Ides and nor languages like today, many things were created "manually"of course large companies had tools and Engines for their games, but there were people who created some things from scratch, including creating a engine usually should be something created almost from scratch.

I will summarize then, in is not the language that gives you the full capacity and much less object orientation to create games efficiently, what perhaps "define" this is the Apis, tools or engine as an example of the Unity 3d, something like this facilitates the creation.

This is not to say that you are not able to create a game from scratch, quite the contrary, any language that allows minimal use of graphic resources (usually by using Apis that control some video feature or graphical API of the operating system) would almost be enough to create something.

If we had the need of a specific language or object orientation then "programmers" in the past, before there were tools like today, would never have been able to create any game.

Answering the questions

That there are differences between the c# language for form programming and for other areas, I am aware

This is not a question, but I will answer, the language is the same, what changes are the Apis or packages used, but the language is not

Object orientation is the part used for game programming?

No, the orientation would be more to organize, whatever the objective of the program

What is the purpose of Object Orientation?

How I answered "organize", but I will indicate the same links that were related (indicated by Maniero):

3

Behold which means object orientation. And what is. And yet a comparison with the functional paradigm. And understand what is paradigm.

So OOP is just a secondary way of organizing codes. It’s a way that helps, but it’s expendable in all cases. It even has more modern languages that deliberately dispensed with its adoption.

Indeed GUI and games are some of the most benefited from its use, but today it is abused and seek to do OOP and there is no advantage. But it itself is not part of GUI or games.

Games rely on libraries and not languages.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.