это код
примечание: в коде есть кое-что, что мне еще предстоит реализовать.
Я использую Pygame, чтобы сделать игру с прокруткой, и пытаюсь понять основы.
import pygame
class Player:
def __init__(self, x, y, size):
self.x = x
self.y = y
self.size = size
self.jumping = False
self.jump_offset = 0
WHITE = (255, 255, 255)
BLACK = 0
W = 1280
H = 720
HW = W / 2
HH = H / 2
win = pygame.display.set_mode((W, H))
CLOCK = pygame.time.Clock()
FPS = 30
pygame.display.set_caption('if the shoe fits wear it')
p = Player(HW, HH, 30)
jump_height = 50
running = True
while running:
pygame.draw.circle(win, WHITE, ((p.x, p.y)), p.size, BLACK)#problem
pygame.display.update()
CLOCK.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
это ошибка
Traceback (most recent call last):
File "C:/pygame/jump.py", line 34, in <module>
pygame.draw.circle(win, WHITE, ((p.x, p.y)), p.size, BLACK)
TypeError: integer argument expected, got float
Process finished with exit code 1
Ожидается целочисленный аргумент, есть число с плавающей запятой