diff --git a/main.py b/main.py index c86102a..80108cb 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,9 @@ import pgzrun -<<<<<<< HEAD import random #随机数生成 random_intX = random.randint(235, 1685) random_intY = random.randint(235, 845) -======= ->>>>>>> 2d13872febf768c59aec106182ed404dbbf57614 music.play('bgm') # 窗口参数 @@ -24,14 +21,12 @@ paddle2 = Actor("2") paddle2.x = WIDTH - 80 paddle2.y = HEIGHT / 2 -<<<<<<< HEAD + #box生成 tbox = Actor("t_box") tbox.x = random_intX tbox.y = HEIGHT / 2 -======= ->>>>>>> 2d13872febf768c59aec106182ed404dbbf57614 # 乒乓球 ball = Actor("ball") ball.pos = (WIDTH//2, HEIGHT//2) @@ -55,10 +50,8 @@ def draw(): paddle1.draw() paddle2.draw() ball.draw() -<<<<<<< HEAD + tbox.draw() -======= ->>>>>>> 2d13872febf768c59aec106182ed404dbbf57614 # 游戏结束提示 if game_state == "gameover": @@ -94,7 +87,6 @@ def update(): if ball.colliderect(paddle1) or ball.colliderect(paddle2): ball_speed_x *= -1 sounds.bump.play() -<<<<<<< HEAD #方块实现 if ball.colliderect(tbox): sounds.bump.play() @@ -113,8 +105,7 @@ def update(): random_intY = random.randint(235, 845) tbox.x = random_intX tbox.y = random_intY -======= ->>>>>>> 2d13872febf768c59aec106182ed404dbbf57614 + # 出左右边界直接失败 if ball.left <= 0: