Pong: How does the paddle know where the ball will hit?

后端 未结 7 2070
旧巷少年郎
旧巷少年郎 2021-02-05 04:16

After implementing Pacman and Snake I\'m implementing the next very very classic game: Pong.

The implementation is really simple, but I just have one little problem rema

7条回答
  •  佛祖请我去吃肉
    2021-02-05 05:14

    Other answers discuss how to decide the correct direction to move in in different circumstances. You can also add a lag time before the computer player "reacts" by starting to move in this direction -- that mirrors the typical response of human players.

提交回复
热议问题