added FPS control

This commit is contained in:
s452645 2021-03-16 06:41:40 +01:00
parent 44154604fa
commit 0d30245e20
2 changed files with 6 additions and 0 deletions

View File

@ -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 === #

View File

@ -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