General Questions for a 2D-Game like FTL



  • Hello!
    I fell in love both with QML and a game called Faster Than Lght ("Screenshot":http://gamescasual.ru/wp-content/uploads/igra_faster_than_light_ftl_1.jpg) and I guess you know what that implies :)
    I'm more experienced with Qt and C++ and the declarative approach is new to me, so I have some general questions about making such a game.

    I use QML for all the graphics stuff, i.e.

    • QML Sprite for animated images
    • QML Image for non-animated images(ok for many small images?)
    • QML Timers for events
    • QML for Input handling
    • (QML for particles)
    • (QML for collision (Box2D))

    Now, i have to integrate this in C++ to get a game-logic.

    • QMLEngine loads all relevant types (maybe 50-100?)
    • Communication via Signals & Slots (I hope its not too slow)
    • Qt&C++ for everything else (network, saving, quest- and fightlogic)

    Is this approach alright? I dont want high-performance but it would be wondeful if this runs on mobile devices :)

    Thank you all!


  • Moderators

    Hi!

    [quote]Is this approach alright? I dont want high-performance but it would be wondeful if this runs on mobile devices :)[/quote]The way you've split things between QML and C++ looks well-optimized to me. QML is optimized for graphics and user interaction, while C++ is best for number-crunching.

    [quote]

    • QML Timers for events
      [/quote]Use a QML Timer to drive QML functions, usea C++ QTimer to drive C++ functions.

    [quote]

    • QMLEngine loads all relevant types (maybe 50-100?)
      [/quote]Use a QQuickView, which is higher-level than a QQmlEngine. Also, you don't need to load the types individually. Just load your "main"/"top-level" .qml file, and it will automatically pull in the others that it depends on.

    All the best with your project!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.