I am messing around with pygame, and trying to create a simple jumping function (no physics yet).
For some reason my "jumps" are not visible in the display, even though the values I am using print out and seem to be working as intended. What could I be doing wrong?
isJump = False
jumpCount = 10
fallCount = 10
if keys[pygame.K_SPACE]:
isJump = True
if isJump:
while jumpCount > 0:
y -= (jumpCount**1.5) / 3
jumpCount -= 1
print(jumpCount)
while fallCount > 0:
y += (fallCount**1.5) / 3
fallCount -= 1
print(fallCount)
else:
isJump = False
jumpCount = 10
fallCount = 10
print(jumpCount, fallCount)
win.fill((53, 81, 92))
pygame.draw.rect(win, (255, 0, 0), (x, y, width, height))
pygame.display.update()
I shortened the amount of code, but I think this is all that is related to the problem.