第 9 步:我们需要有关球速的信息!在游戏过程中,球会多次击中桨和砖!每次,我们都需要球的速度,以便我们能够根据球是否击中桨或砖来改变 x 或 y 速度。

  • 在碰撞事件中添加Get x Speed ,就在hit_sprite .get_color()
  • 将新的my_var (在.get_x_speed()命令之前!)更改为ball_x_speed

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)