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?

4 Answers4

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.

igordsm
  • 131
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++

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.

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.