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 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.

    JonBJ 1 Reply Last reply
    0
    • T treej4

      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.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 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 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.

        JonBJ 1 Reply Last reply
        0
        • T treej4

          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.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on 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
            2
            • SGaistS SGaist

              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 last edited by
              #6

              @SGaist Thank you! Will do.

              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