I\'m messing around with Pygame, making some simple games just to learn it. However, I\'m having a hard time implementing fps the way that I want.
From what I unders
You can define the speed of your objects in pixels/second, then use the returned value from tick
to know how much every object should move.
Example
import pygame
...
player_speed = (20, 0) # (x,y) pixels/second
...
pygame.time.Clock() = clock
elapsed = 0.
while True:
seconds = elapsed/1000.0
update_player(seconds)
...
elapsed = clock.tick(60)
def update_player(seconds):
player.position = (player.position[0] + int(player_speed[0]*seconds),
player.position[1] + int(player_speed[1]*seconds))