美文网首页
scratch programming-pong game(弹球

scratch programming-pong game(弹球

作者: 思求彼得赵 | 来源:发表于2020-09-20 11:27 被阅读0次

    2020-09-20


    pong game

    This case is from the Scratch tutorial.
    In the game, the ball will bounce in the canvas.
    if it is touched with the paddle, which will run with the mouse, it will turn to the contrary direction and continue to move. the score will add one.
    and if it drops on the red banner, that means it is on edge and will bounce.
    the code for the ball is like this:

    1. the ball move and bounce freely.


      image.png
    2. determine if the ball touches red color.


      image.png
    3. determine if the ball touches the paddle.


      image.png
    4. control the ball to move to the mouse pointer.


      image.png
    5. welcome to test it and try to make a new game based on it.
      https://scratch.mit.edu/projects/427266613

    相关文章

      网友评论

          本文标题:scratch programming-pong game(弹球

          本文链接:https://www.haomeiwen.com/subject/pkbuyktx.html