Archived:How to develop brick-breaker game in PySymbian - Part 3
Finally we have the last article in the series of "How to develop brick-breaker game in Python. If you have followed the previous articles in this series, then after finishing this one, you should be able to create your own Brick-breaker or similar game using PyS60.
In this article- Part 3, we would learn about the code for the moving ball, intializing the bricks parameter, slider parameter and sequence of calling functions. Let's discuss them in detail.
Code for moving the ball
Here we have a little code for moving the ball in canvas. This ball is moving automatically.
Thus the code for moving the ball could be as follows:
# import module
#define exit function
#Set the screen to large
#Create an instance of Canvas and set it as the application's body
#define circle coordinate
if ((y1<0) or (y1>k-15)):
# Sleep for 0.1
Sequence of calling functions
The defined functions need to be called in a proper sequence. sequence of calling functions are as follows:
erase_bricks(12) #Should be called when collision is detected- See Related Links
app_lock = e32.Ao_lock()
The this article in the series- Part 3 for brick-Breaker , cover whole brick breaker game in canvas.
We have concluded the series of articles related on "How to develop Brick-Breaker game. If you have followed this series, you would be able to create a Brick-Breaker game in Python for S60.