摘要: 1.比如在游戏中经常需要从一个点移动到另一个点,给出坐标、位移和角度,就可以计算出新的坐标: # math包提供了sin()和 cos()函数,我们先用import引用它: import math def move(x, y, step, angle): nx = x + step * math.cos(angle) ny = y - step * math.sin(angl... 阅读全文
posted @ 2019-08-14 15:06 谈晓军 阅读(162) 评论(0) 推荐(0) 编辑