Brick Breaker, Need help on moving the panel and the ball
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?
2 replies
Assuming this is a 2D game, you should look into the Graphics View Framework [qt-project.org]
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 [qt-project.org]
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.
You must log in to post a reply. Not a member yet? Register here!
