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. Making Space Invaders
QtWS25 Last Chance

Making Space Invaders

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 646 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.
  • T Offline
    T Offline
    treej4
    wrote on 13 Apr 2022, 14:54 last edited by
    #1

    I am re-making space invaders for a class project. And I wanted to know the documentation I would need in order to make objects move such as the little invaders and bullets.

    Or even in general, what documentation would be needed in order to make the game Space Invaders.

    J 1 Reply Last reply 13 Apr 2022, 15:20
    0
    • T treej4
      13 Apr 2022, 14:54

      I am re-making space invaders for a class project. And I wanted to know the documentation I would need in order to make objects move such as the little invaders and bullets.

      Or even in general, what documentation would be needed in order to make the game Space Invaders.

      J Offline
      J Offline
      JonB
      wrote on 13 Apr 2022, 15:20 last edited by
      #2

      @treej4
      I would use a QGraphicsScene. Create QGraphicsPixmapItems for your invader "sprites" and move them around. Just creating 2 sprites for each invader, with his "legs" open & closed, and alternating between them gives an authentic SI feel :)

      1 Reply Last reply
      1
      • T Offline
        T Offline
        treej4
        wrote on 13 Apr 2022, 16:38 last edited by
        #3

        Gotcha, I'm assuming in QGraphicsScene there is some method that tracks an object moving? I think my hurdle will be getting the objects to move and tracking moving objects.

        J 1 Reply Last reply 13 Apr 2022, 17:28
        0
        • T treej4
          13 Apr 2022, 16:38

          Gotcha, I'm assuming in QGraphicsScene there is some method that tracks an object moving? I think my hurdle will be getting the objects to move and tracking moving objects.

          J Offline
          J Offline
          JonB
          wrote on 13 Apr 2022, 17:28 last edited by JonB
          #4

          @treej4
          The "objects" are all QGraphicsItems. QGraphicsPixmapItems are QGraphicsItems which hold a bitmap/picture. Each one is an object with its own (x,y) position which you can read and move. The scene keeps a list of these objects which you can access, and you can keep your own references/lists if you wish as well.

          You view the scene through a QGraphicsView attached to a scene. In your case you will want just one scene with one view.

          1 Reply Last reply
          2
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 13 Apr 2022, 18:22 last edited by
            #5

            Hi,

            You should take a look at the graphics view examples. For example, the colliding mice one will show you how to move elements and do collision detection.

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

            T 1 Reply Last reply 13 Apr 2022, 20:53
            2
            • S SGaist
              13 Apr 2022, 18:22

              Hi,

              You should take a look at the graphics view examples. For example, the colliding mice one will show you how to move elements and do collision detection.

              T Offline
              T Offline
              treej4
              wrote on 13 Apr 2022, 20:53 last edited by
              #6

              @SGaist Thank you! Will do.

              1 Reply Last reply
              0

              1/6

              13 Apr 2022, 14:54

              • Login

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