Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to layout the code of a simple game? [closed]

I'm coming from a background mostly developing websites, and maybe some simple form-based apps. MVC works well for that, but I don't quite see how that's applicable to a game. So how do you guys do it?

I'm developing with Qt and OpenGL, if that's relevant. I have a QGLWidget which I'm basically using as a central hub at the moment. Should it pass off input to a Player object so that it can handle it, or should it control the player directly? Should objects draw themselves, or should there another handler for that? Basically, what goes where? Who handles what?

Links to relevant articles, answers to some of these questions, tips, or file structures are all appreciated. I don't really care about how to program it, just how to modularize nicely.

Thanks :)

like image 799
mpen Avatar asked Aug 11 '09 01:08

mpen


People also ask

What is the easiest way to code a game?

JavaScript is the coding language that helps support most of the interactivity that you can find on the web, which has made it a pretty popular language to learn. Its extremely flexible and lightweight nature makes it a great choice for building browser-based games that can be played on computers or mobile phones.

How game code is written?

Most games are written with custom code based on the C programming language. A 3-D code engine is almost always used to generate the incredibly complex code necessary for all of the polygons, shadows and textures the user sees on the screen. Another important aspect of the code is the artificial intelligence component.

Can you make a game with block coding?

Make a game with GamebloxGameblox is a game editor that uses a blocks based programming language to allow anyone to make games. It's free and no downloads are required. You can make games online that you can play both on this site and on your mobile device. Make a Game!


1 Answers

Well, the cliche starting point for game development seems to be gamedev. There are a number of tutorials and articles to start from, there. It also has quite an active forum. There is also book, "Programming Linux Games" (I assume through Qt that you're using Linux), but I believe it costs money. A number of books, however, can be found on the internet, and that may be one of them.

There's also the "black art of game programming", a wiki with truly terrifying chapter titles. Here is a link to a particularly relevant chapter, though of course you can view the whole thing: Chapter 2. (archive.org backup link)

Hope this helps, - Agor

like image 144
agorenst Avatar answered Oct 14 '22 19:10

agorenst