ShallWeLearn | shallwelearn.com2Click the green flag to try the game. Use the paddle to hit the ball as it fallsdown. You should soon find that if the ball hits the bottom of the Stage, thegame would end.
The ball sprite has three comboblocks. You can think of a sprite as a
robot
and each combo block as
aseparate motor
. Just like a robot iscontrolled by many motors, a spritecan be controlled by many comboblocks. In Computer Sciencelanguage, each combo block is
a
thread
of execution
, workingindependently of the other threads.In the picture shown left, first comboblock controls how the game wouldend - if ball touches red, then gameends.The middle combo block checkswhether the ball has touched thepaddle and takes action when it does.The last combo block checks whetherthe ball has hit the edge and takesaction when it does.
Add a Comment