Friday, March 15, 2019

Adding Bricks to the Game

In the previous step, we have added a paddle to our game. In this step, we will be adding some bricks, so that the ball can strike and break them. There might be some weird movements of the ball as I have not added too much complexity to the program. I have done so intentionally, so that the code remains simple to understand. Further fine tuning can be done and some extra features can be added like the paddle shooting the ball at different angles depending on where on the paddle the ball strikes. You can also add different levels to the game and end the game if the ball misses the paddle.

Code:


Output:


Graphic for the icon:


Graphic for the ball:


Graphic for the paddle:


Graphic for the bricks:


No comments: