Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // keep playing until game over
- while (lives > 0 && bricks > 0)
- {
- // TODO
- double velocity = 2.15;
- while(true)
- {
- move(circle,velocity,velocity);
- if (getX(circle) + getWidth(circle) >= getWith(window))
- {
- velocity = -velocity;
- }
- else if (getX(circle) <= 0 )
- {
- velocity = - velocity;
- }
- else if (getY(circle) <=0)
- {
- velocity = -velocity;
- }
- else if (getY(circle) >= 540)
- {
- velocity = -velocity;
- }
- pause(10);
- }
- }
- // wait for click before exiting
- waitForClick();tantiate bricks
- initBricks(window);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement