Skip to content

Commit

Permalink
fixed refresh rate stuff for windows
Browse files Browse the repository at this point in the history
not mkaing icon lol
  • Loading branch information
quasar098 committed Apr 3, 2022
1 parent 592f267 commit 3cdabb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
from pygame import Color
import platform
from win32api import EnumDisplayDevices, EnumDisplaySettings

# pygame stuff
WIDTH, HEIGHT = 1280, 720
FRAMERATE = 75 # todo change this to windows default or 60 default when game released
FRAMERATE = 60 # change this to your monitor refresh rate if using windows, dont have a linux or mac to test it on
if platform.system() == "Windows": # windows
FRAMERATE = EnumDisplaySettings(EnumDisplayDevices().DeviceName, -1).DisplayFrequency
if platform.system() == "Linux": # linux
pass
if platform.system() == "Darwin": # mac
pass

# game colors
BG_COLOR = Color(255, 255, 255) # white
Expand Down
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

screen = pygame.display.set_mode([WIDTH, HEIGHT])
pygame.display.set_caption("Conveyor Belt Attack")
# todo: make an icon for the game
font = pygame.font.Font(get_path("assets", "font.ttf"), 36)
bigger_font = pygame.font.Font(get_path("assets", "font.ttf"), 48)
timer_font = pygame.font.Font(get_path("assets", "timer.ttf"), 48)
Expand Down

0 comments on commit 3cdabb4

Please sign in to comment.