3

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?

3
  • 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. Oct 16, 2014 at 0:48
  • 1
    @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.) Oct 19, 2014 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. Oct 19, 2014 at 9:49

4 Answers 4

3

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.

2

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++

4
  • 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) Apr 3, 2013 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. Apr 3, 2013 at 18:12
  • Ah, I see. But Java-itself can be ran on Ubuntu Touch right? Apr 4, 2013 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 Apr 4, 2013 at 1:02
1

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.

2
  • 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. Oct 16, 2014 at 0:47
  • You're right David! QML + ECMAScript (JavaScript) would be the correct term, alias Qt Quick.. Oct 16, 2014 at 9:01
0

This is already an older thread and I think some up-to-date answers are missing:

  • You can program your game entirely in Qt Quick/QML but use a physics engine as a plugin. This is useful if your game involves moving bodies and collisions. A great physics plugin is QML-Box2D. The game qArkanoid is written this way.
  • If you don't need a physics engine, you can get by even with pure QML, see QML Sokoban or Dropping Letters.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .