我想通過(guò)給它更小的 y 和 x 變化來(lái)減慢圓的運(yùn)動(dòng),如下所示:if event.key == pygame.K_DOWN: circleYchange = 0 circleXchange = 0 circleYchange += 0.5 if event.key == pygame.K_RIGHT: circleYchange = 0 circleXchange = 0 circleXchange += 0.5然后將其添加到circleY和circleX中,并繪制圓:circleX += circleXchangecircleY += circleYchangepygame.draw.circle(screen, (0, 0, 0), (circleX, circleY), size)但它給了我這種錯(cuò)誤:TypeError: integer argument expected, got float如何減慢運(yùn)動(dòng)速度?
減慢pygame中的移動(dòng)圓
ibeautiful
2023-10-11 21:40:30