added FPS control
This commit is contained in:
parent
44154604fa
commit
0d30245e20
5
main.py
5
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 === #
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user