So, I'm making a game that I am having multiple problems with as it is my first one. One of the problem is that whenever I open it only a -5 pops up and then the program starts working. I think this is because of this specific warning below:
Warning (from warnings module):
File "C:/Users/LENOVO/Desktop/Everything Here!!/MoreCollision.py", line 57
win.blit(text, (250 -(text.get_width()/2), 200))
DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
And the code belonging to it is:
def hit(self):
self.x = 60
self.y = 410
self.walkCount = 0
font1 = pygame.font.SysFont('comicsans', 100)
text = font1.render('-5', 1, (255,0,0))
win.blit(text, (250 -(text.get_width()/2), 200))
pygame.display.update()
i = 0
while i < 300:
pygame.time.delay(10)
i += 1
for event in pygame.event.get():
if event.type == pygame.QUIT:
i = 301
pygame.quit()
So, I really have no clue how to fix it. Please help if anyone can.