Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Colliding Mice behavior coding
QtWS25 Last Chance

Colliding Mice behavior coding

Scheduled Pinned Locked Moved General and Desktop
colliding micecodingc++
6 Posts 2 Posters 1.5k Views
  • 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.
  • R Offline
    R Offline
    ralph1515
    wrote on last edited by
    #1

    I am trying to code of how the mice will behave based on the following algorithm.

    1.) A mouse will move at a straight line in a random direction.
    2.) If it collides with another mouse, it will move in another direction.

    I am new to qt so I'm having a hard time on how to code this.

    Any coding help is very much appreciated. Thank you!

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

      Hi and welcome to devnet,

      Are you looking for the Colliding Mice example ?

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

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you looking for the Colliding Mice example ?

        R Offline
        R Offline
        ralph1515
        wrote on last edited by
        #3

        @SGaist Hello! I've already found the Colliding Mice example. I'm just trying to figure out how to code the algorithm to the mice.

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

          It's all done in the Mouse class in the advance function

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

          R 1 Reply Last reply
          0
          • SGaistS SGaist

            It's all done in the Mouse class in the advance function

            R Offline
            R Offline
            ralph1515
            wrote on last edited by
            #5

            @SGaist Any chance you could help me code the algorithm?

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

              What do you mean ?

              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