-
Develop games in C?
Hello,
I started learning C programming language at my college and I have idea and sketches for a Symbian^3 game. I wonder can I create 2D game in Qt Creator only using C programming language?
Game should have scores, that character is able to move from left<->right, that he can dodge objects and interact/collide with them, that background is moving (new object are coming and you need avoid them)...
Thank you.
-
Re: Develop games in C?
Pure C won't work with Qt (need some C++, too), but you can mix C with C++ in various ways (C++ is more or less a superset of straight C).
Might be easier, though, to pick up Java, instead of C++ with its Qt and then more difficult Symbian C++ variant quirks.
-
Re: Develop games in C?
If you want to develop in pure C, you would just need a "wrapper" of Qt and C++, just to set up application and handle events etc - this would be one or 2 classes, and then it could pass on to your C engine from there. The EPong or QtGameEnabler examples would be a good starting point, as they are already structured like this (separate wrapper and actual game)
-
Re: Develop games in C?
If you want to have extremely portable game then plain C/C++ is a good option as magicdave already replied.
EPONG was created portability in mind and all the game logic is pure C/C++:
[URL="https://projects.developer.nokia.com/eponggame/browser/trunk/epong_game_logic"]https://projects.developer.nokia.com/eponggame/browser/trunk/epong_game_logic[/URL]
Then we have platform dependent code for Symbian C++ and Qt C++ so the project compiles nicely for Symbian SDK and Qt SDK. It would be possible to easily create Android and iPhone ports of this game as well.
-
Re: Develop games in C?
If you can already code in C, why not learn Qt? It is very easy to learn!
-
Re: Develop games in C?
Can you tell me what is the best book for learning Qt from beginning?
And, how hard is it, how much experience do you need to have to programme game like Doodle Jump (I hope you know the game)?
-
Re: Develop games in C?
Having written a German Qt book myself, I am obviously biased. My issue is also that I know only German books - can you read this language?
-
Re: Develop games in C?
Unfortunately, I don't know German language so I can't read German books. Only books on English and Croatian language are option.
-
Re: Develop games in C?
Oh my. There is an official book from TrollTech which was my first contact with Qt, but while complete, it was a bit confusing.
APress is said to have a current one with Jakl involved, but I have not had it in my hands yet (and wont as I can not review APress stuff being an APress author soon).
-
Re: Develop games in C?
Do you already know a decent amount of C++? If so, learning Qt is simple enough without a book. The standard things like strings or vectors function much as you'd expect, and the web has plenty on Qt specifics like signals and slots. The online documentation is very good. Basically read some intro to Qt programming pages till your head is full of them and then look through a few of the examples that come with the SDK, and you should be fine.
-
Re: Develop games in C?
Is there any way to open .sis file and see source code of application or game? I tried to open .sis file in Qt Creator, but only lot of numbers appeared.
I don't want to copy anyone's hard work or something like that, I just want to see examples and see how they created some things.
-
Re: Develop games in C?
The .sis files can be unpackaged, but you won't find any source code inside. The source code is compiled to ARM processor instruction set binaries before being packaged as .sis files.
-
Re: Develop games in C?
Examples are more easily found in the Resources above, item "Code examples".
-
Re: Develop games in C?
You can try the game examples here: [URL="http://www.developer.nokia.com/Community/Wiki/Category:Games"]http://www.developer.nokia.com/Community/Wiki/Category:Games[/URL]
Based on your question about .sis files and the fact that you are recently started learning C, I would recommend that you spend a bit of time on simpler examples in C/C++ before jumping straight into making the game you want to make.