diff --git a/main.py b/main.py index d98bdca..61af3bd 100644 --- a/main.py +++ b/main.py @@ -11,6 +11,9 @@ def main(): pygame.init() pygame.display.set_caption(const.V_NAME_OF_WINDOW) + # FPS clock + clock = pygame.time.Clock() + # for blocky textures glEnable(GL_TEXTURE_2D) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) @@ -20,6 +23,8 @@ def main(): running = True while running: + # FPS control + clock.tick(const.V_FPS) # ================ # # === GRAPHICS === # diff --git a/project_constants.py b/project_constants.py index 91e38c1..63ae841 100644 --- a/project_constants.py +++ b/project_constants.py @@ -14,6 +14,7 @@ import os V_NAME_OF_WINDOW = "MineFusion TM" ASSETS_DIR = os.path.join("resources", "assets") +V_FPS = 60 V_TILE_SIZE = 60 V_GRID_VER_TILES = V_GRID_HOR_TILES = 10 # vertical, horizontal