Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Controlling sprite move
Qt 6.11 is out! See what's new in the release blog

Controlling sprite move

Scheduled Pinned Locked Moved Game Development
3 Posts 3 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    theCrazyCrap
    wrote on last edited by
    #1

    Hi! I am creating this platform game and part of my platform game is the movement of the character

    I have already created a serquence of pictures that shows the character walking. What I wanted to do is when I clicked a button, the character will move...

    Is it possible here at Qt?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jake007
      wrote on last edited by
      #2

      Yes it is.
      You can create an action ( "QAction":http://developer.qt.nokia.com/doc/qt-4.8/qaction.html), or you can inherit function keyPressEvent ( QKeyEvent * event ).


      Code is poetry

      1 Reply Last reply
      0
      • M Offline
        M Offline
        music24by7
        wrote on last edited by
        #3

        Doing a sprite animation is simple, Create an array with the list of your pictures.
        You can have an timer which will advance this array.

        Go through the "Qt Flying Bus example":http://developer.qt.nokia.com/wiki/Flying_Bus_Game

        You can find the FrameSprite, which will give you the idea about how to achieve it.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved