QGraphicsView is something I would use for creating such game.
You can reimplement QGraphicsItem, so you get a DuckItem, where you can implement all the logic for moving a duck. You will get QMouseEvents directly to your item, so killing a duck is just a proper handling of events sent to your class.
Why would you want to do that? What platform are you targeting ? You can of course use any drawing tools to create pictures and save upload it. Remember qrc (mobile) is for small files.
[quote author="BrEaDFace" date="1303459182"]Is there any other way than drawing alot of pics as .png format and uploading with resource file?[/quote]
Yes they can. MeeGo is closely integrated with Qt and therefore with QML, and it's the official platform.
If you create apps using Qt/QML you can also reach other mobile platforms. There will be phones later this year. You can also run them on Symbian ^3, and Maemo.
As for is it the best for games. Probably not. There are other specialized libraries for games, which are better, but with Qt/QML you can reach the biggest audience, because it runs on so many platforms. As I heard there are unofficial ports of Qt to android, iPhone, WebOS and many more.
Not long ago I started working on a QML game "Sink Submarines":https://projects.forum.nokia.com/sinksubmarines for the "MeeGo Coding Competition 2011":http://talk.maemo.org/showthread.php?t=71561
You could join us. :)
In my opinion it is always easier to explain such kind of algorithm with a block diagram (espesially if it is executed by a single thread) :) You can also get inspiration for optimal solution from existing solutions for path finding algorithms such as the different implementations of the traveling salesman problem ;)
yes, but if i need do all mouse input in C++ i need do all draw with in C++ too. (if exists a way t get mouse input of a qml elementet in C++ tell me. I don't find one yesterday, only mouse global coordinates)
So, i will use qml for what?
From my experience, the performance is quite good. I use QGLWidget to setup the context and that's about it. From then on, I write all of the other OpenGL code myself. That includes creating textures, rendering fonts and images. I havn't seen any slowdown when doing this. I've also been able to use the QGLWidget in an editor tool without any problems. In that case, I still do all the OpenGL rendering myself, but the widgets for the rest of the tool is rendered outside of the OpenGL context by Qt. I've not tried rendering Qt Widgets inside of the OpenGL widget.
Integrating Box2D is pretty simple. There was a Qt Labs post about it awhile ago. I was also able to integrate it into my game engine. It's works very well. The one thing to watch out for is the differences in scale. Box2D works will with things on the order of 10 units. If you match one Box2D unit to one pixel, you won't have very good results. So what I did was apply a constant scale factor when converting from Qt/pixel coordinates to Box2D coordinates.
[quote author="sleam" date="1296516870"]Well done for the time spent!
I like the game design, nice idea to make the game go dark at certain spots!
thanks very much!
Thank you for sharing with us.[/quote]
It is a pleasure, I always wanted to do something for the developers community.
Also, if you could elaborate a little on what you are trying to show and which events need to take place, someone would be able to help. Right now, the way I understand your code, calling show() would be the first command required to 'see' anything, but you wrote it's already visible.
It depends upon how you will launch your game. If you want it to only reside on a windows(as DirectX is platform Dependant) based machine, then by all means use DirectX(and yes you can use it with Qt from what i understand, but you must override the Qt paint event to null in order to render properly), DirectX tends to be much easier to use than openGl, and by easier I simply mean you can do more in less lines of code generally. I have used both and it simply boils down to preference. If you use openGl, you do not have to do any workarounds, if you use DirectX to create the UI you do.
QGraphicsItem::setTransformOriginPoint(x, y) is working perfectly for me with smooth 60fps animation in a game on Symbian (N8). I'm not using the animation class on top though - I'm doing the rotation myself in the game loop.
This is what I found when I started working with Boost. I did some basic math and figured that I wouldn't really gain any significant performance improvements over using my own code.
Of course, I am running this code on a very small set of data. At the most, some of the datasets will only contain perhaps 100 elements. If I were coding against a very large (and/or complicated) set of data (i.e. pattern matching across thousands of elements is a good example) then I would rethink my using Boost.
Hello xsacha, thanks for the link, I'll be sure to keep it updated when possible. The size of the company doesn't matter as long as they're making or made a game with Qt, it can be an indie group as well.