Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a bit of interest in developing for Ubuntu Touch (I have little to no real coding experience also), but my main interest is trying to develop a 2D game.

From my understanding, I would either have to use QML for the interface + another language for the game itself, or just use another language for the interface and game, but pretty much, QML is only good for interfaces.

Is this true? If so, what's the best choice for another programming language to learn?

share|improve this question

closed as primarily opinion-based by Braiam, mikewhatever, KasiyA, v2r, Whaaaaaat Oct 20 at 5:49

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Those are actually 2 questions and the 2nd (“If so, what's the best choice for another programming language to learn?”) is primarily opinion based an therefore off topic on AU. –  David Foerster Oct 16 at 0:48
    
@DavidFoerster This question contains a small afterthought that would be primarily opinion-based if it were the entire question. That tiny part of this question should possibly be removed or changed, but I don't think it condemns this whole question even if (or for however long) it remains. (I'm not disagreeing with what you've said, but it's nowhere near a reason to close this.) –  Eliah Kagan Oct 19 at 2:43
    
I agree. My concern was to remind people who want to write answers to not go overboard on the opinion based part but focus on the QML stuff. –  David Foerster Oct 19 at 9:49

3 Answers 3

It all depends on the game you're designing and what sort of graphics device you'd like to use. For example if you want to use OpenGL I would suggest using java or C++. You can develop games for ubuntu an multiple different languages but probably the best to do it in are java and c++ because they are cross platform. I know this from experience. Also check into Python, I heard it's also very useful when making a cross platform game.

If you're trying to make this an Online game for a networking library you can't use things such as .net and winsock you have to use a 3rd party networking library or write your own. .net and winsock are microsoft only and won't work under linux which is the main reason most games are developed in windows.

Enjoy and goodluck on the development of your new game!

P.S if you need an interface I suggest checking out QT or OpenGL in C++

share|improve this answer
    
Hmm, I wouldn't mind trying to use Java. Could I use QML and Java together easily (QML for the interface, Java for everything else)? And could Java also be used on Ubuntu Touch? (Nexus 10) –  Espionage724 Apr 3 '13 at 4:16
    
that's all dependent whether or not java is compatible with a QML library before actually starting your game I suggest doing any necessary research on your project. –  Dylan Dodds Apr 3 '13 at 18:12
    
Ah, I see. But Java-itself can be ran on Ubuntu Touch right? –  Espionage724 Apr 4 '13 at 0:56
    
of course! java is cross platform and runs on nearly every device that you can think of! android, ios, linux, windows, and the list goes on. It's why popular games such as Minecraft and Runescape work on almost any operating system –  Dylan Dodds Apr 4 '13 at 1:02

Yes, you can develop a game completely using QML. There is a Qt Quick advanced tutorial on this link (http://qt-project.org/doc/qt-5.0/qtquick/qtquick2-qml-advtutorial.html) that builds a game this way.

The new Sprite(http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-sprite.html) and AnimatedSprite elements may be very useful for you.

share|improve this answer

QML is definitely a great option for creating 2D games and can save you a lot of time and lines of code compared to other languages.

As an example, V-Play (www.v-play.net) is a cross platform 2D game engine based on Qt/QML with many useful V-Play QML game components for handling multiple display resolutions & aspect ratios, an entity & component system, animations, particles, physics, multi-touch, gestures, path finding and more (API reference).

As part of the engine download, you get 12+ sample games with full source code, which are completely written in QML. These games are real published games from the app stores. You can find the games here.

This proves that QML can be used for fully published and polished 2D games. And if you do need something very performance-sensitive in your game, you can just write that component in C++ and provide it as a QML component.

share|improve this answer
    
While you're technically right, one still needs to know ECMAScript in general to describe Turing-complete behaviour with QML. The interface declarations alone won't do for a whole game. –  David Foerster Oct 16 at 0:47
    
You're right David! QML + ECMAScript (JavaScript) would be the correct term, alias Qt Quick.. –  Christian Feldbacher Oct 16 at 9:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.