在pygam中移动精灵前后

2024-04-26 21:41:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我让精灵从屏幕的另一端移动到另一端,但现在我希望它永远来回移动。有什么想法吗?在

u = 1 #u is the x coordinate
if u < 430: #480 is the window siz, i want it to stop at 430
   u += 5 # Move up by 5

我应该添加我的全部代码,这样更容易吗?在


Tags: thetocoordinatemoveif屏幕isit