我有一个上下移动的火球,但问题是当它向下移动的时候,它有一个向下移动的快照,看起来火球实际上根本没有平稳地上下移动。有没有办法让这更好
我想让它像火球一样落下,而不是像弹跳一样
在我的主循环中,我有子弹移动的速度和方向
for shot in shots:
if shot.direction == "down": # if the direction is down add to the y
shot.y += 2
if shot.direction == "up": # if the direction is up minus- to the y
shot.y -= 2
if shot.y <= 200: # if the object y is <= 200 then change the direction and add to the y
shot.direction = "down"
if shot.y >= 700: # if the object y is >= 700 then change the direction and minus the y
shot.direction = "up"
使用^{} 怎么样:
或^{} :
相关问题 更多 >
编程相关推荐