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. Brick Breaker, Need help on moving the panel and the ball
Qt 6.11 is out! See what's new in the release blog

Brick Breaker, Need help on moving the panel and the ball

Scheduled Pinned Locked Moved Game Development
3 Posts 3 Posters 3.7k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi there

    We've received an assignment to create a basic brick breaker game. I am very new to qt and I'm struggling on finding a way how to move the panel over the screen, as well as the bouncing and moving of the ball. The rest I am able to do.

    Can anyone help me with this please?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Arcanoid clone? You'll want to capture mouse events (or touch events) for moving the paddle and then you need to apply simple collision detection with the ball against the edges, paddle and the blocks. 2D vector math & reflection vector are your friends there.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RavensAngel
        wrote on last edited by
        #3

        Assuming this is a 2D game, you should look into the "Graphics View Framework":http://qt-project.org/doc/qt-4.8/graphicsview.html

        When you use the QGraphicsItem as base class for your viewable items, you get the collision detection algorithm for free. Allthough not the top of the edge, it will satisfy your needs.

        You should check the "Colliding Mice example":http://qt-project.org/doc/qt-4.8/examples-graphicsview.html

        It will show you how to move items etc, also look at Asteroids.

        The logic behind the original arcanoid, was very simple towards ball movement. It will change the velocity of the ball depending on the collision location (left, middle, right).

        I think you have enough to look at, so get started.

        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