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. Trouble Converting Mouse into Player Object
Forum Updated to NodeBB v4.3 + New Features

Trouble Converting Mouse into Player Object

Scheduled Pinned Locked Moved Unsolved Game Development
4 Posts 2 Posters 1.1k 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.
  • L Offline
    L Offline
    LoganB
    wrote on last edited by
    #1

    I am creating a game that essentially shoots pixmap objects at the player, and his job is to dodge them for as long as possible. Originally I wanted the players sprite to be tracked to the mouse because this would allow for a lot more mobility on the players side than using keyboard inputs. However, after numerous hours of reading I cannot seem to convert the mouse cursor itself into an object that can detect the collisions or overlay an object to follow the mouse. Any suggestions would be greatly appreciated, thank you for your time.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You should add more information like:

      • the Qt version you are using
      • the technology you are using (QtQuick, Graphics View framework, qml-box2d, etc.)
      • the platform you are targeting
        etc.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LoganB
        wrote on last edited by
        #3

        Thanks for the feedback, sorry for the vague nature of the question. I am using the Qt 5.8.0 64 Bit Desktop version, and I am currently building everything inside the Qt Creator itself. I'm setting the scene with QGraphicsScene, and then displaying objects with addItem to the standard scene. This is not being developed for any platform specifically, the program in question is part of my final project for my C++ class. I would also like to apologize if this question is located in the wrong section of the forum. I'm very new to the forum itself and relatively new to Qt in general.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          So if I understand you correctly, you'd like to have an item locked on your mouse cursor to move around for your game, while the cursor itself is hidden. Correct ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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