score = 0 speed = 4.0 gr.open 255, 255, 255, 255 gr.orientation 1 gr.color 255, 30, 30, 30, 1 % play area gr.rect area, 0, 300, 0, 300 % play area gr.color 255, 255, 0, 0, 1 gr.circle ball, round(rnd() * 300), 0, 10 gr.color 255, 0, 0, 255, 1 gr.rect player, 150, 280, 200, 300 gr.text.draw scoreboard, 0, 350, "Score: " + str$(score) gr.render do do gr.touch touched, x, y until touched gr.get.position ball, x1, y1 gr.get.position player, x2, y2 if x < (x2 + 15) let direction = -10 elseif x > (x2 + 35) let direction = 10 else let direction = 0 endif gr.modify ball, "y", y1 + round(speed) gr.modify player, "left", x2 + direction gr.modify player, "right", x2 + 50 + direction gr.render if gr_collision(ball, player) score = score + 1 speed = speed + 0.2 gosub positionBall endif if y1 > 300 score = score - 1 gosub positionBall endif gr.render pause 5 until 1 = 2 positionBall: gr.modify scoreboard, "text", "Score: " + str$(score) gr.modify ball, "y", 0 gr.modify ball, "x", round(rnd() * 300) return OnBackKey: popup "Score: " + str$(score),0,0,1 end