Creating a platform game



  • Hi guys!
    I am doing this project of creating a platform game. And my professor told me to do it with Qt. I just wanna ask a few question if you will.. How can I integrate physics into the environment? because it's like mario with the over head platform. Second, how can i apply a second layer of image in the game because I am going to put up the controls in the screen (up,left,right). So once the character moves, the controls shouldn't move right, is it possible?

    Thanks!!



  • Hi,

    for physics you can use Box2D for Qt http://developer.qt.nokia.com/wiki/box2d



  • Yes, Box 2D is quite an impressive physics engine. It powers the Angry Birds :)



  • Ok, I'll look into that... How about adding another layer of image? I'm thinking of putting of controls in the screen. But the problem is the background will be moving and the controls shouldn't move.

    Thank you for your help!



  • Do develop the game in C++ or in QML?

    Controls will move only if they are positioned relatively to background. Background and Controls are just items(images or some more complex structures) you decide how to position them.



  • I'm doing it in QML... I get it now... In background itself, do we create a very long image so that the phone will just scroll as the characters move?



  • You can write something like that:
    @
    Item {
    id: screen

    Item {
    id: game

    // here you put background you will move

    width: screen.width
    height: screen.height
    }

    Item {
    id: controls

    // here you put your controls

    anchors.left: screen.left
    z: 1
    }

    Item {
    id: skills

    // here you put your controls

    anchors.rigth: screen.right
    z: 1
    }
    }
    @
    In game you can put your background and everything you want to move. And just change their x and y coordinates or you may use "Flickable":http://doc.qt.nokia.com/4.7-snapshot/qml-flickable.html
    You can read more about anchros "here":http://doc.qt.nokia.com/4.7-snapshot/qml-anchor-layout.html

    NOTE: I used Item because I don't know what you need, but it can be any QML element you want.



  • Thank you so much! Very much Appreciated..


Log in to reply
 

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