]> Skullheadx's Git Forge - fruit-ninja.git/commitdiff
fix sdl2 related issues + screen tear on macos
authorSkullheadx <admonty1@gmail.com>
Wed, 4 Sep 2024 20:02:03 +0000 (16:02 -0400)
committerSkullheadx <admonty1@gmail.com>
Wed, 4 Sep 2024 20:02:03 +0000 (16:02 -0400)
.gitignore
game.py
menu.py
setup.py

index 3eb56cb1b2b440b4f8be065c26fb0972fe724648..27f9903bb402d01ada7333bfe4ea4b7497301a58 100644 (file)
@@ -150,3 +150,4 @@ cython_debug/
 #  and can be added to the global gitignore or merged into this file.  For a more nuclear
 #  option (not recommended) you can uncomment the following to ignore the entire idea folder.
 .idea/
+high_score.txt
diff --git a/game.py b/game.py
index b07d96c91ef956a3262e77544e058f769aaf2c80..9f087ee06823beb995f091dbe2b0a139135a8046 100644 (file)
--- a/game.py
+++ b/game.py
@@ -17,10 +17,9 @@ class Game:
     BACKGROUND = pygame.Surface((WIDTH, HEIGHT))
     tile_cols = 4
     tile_rows = 4
-    background_tile = pygame.transform.scale(pygame.image.load("assets/background.png"),
-                                             (WIDTH / tile_cols, HEIGHT / tile_rows)).convert()
+    background_tile = pygame.transform.scale(pygame.image.load("assets/background.png"),((WIDTH+12) / tile_cols, HEIGHT / tile_rows)).convert()
     dark_background_tile = pygame.transform.scale(pygame.image.load("assets/dark_background.png"),
-                                                  (WIDTH / tile_cols, HEIGHT / tile_rows)).convert()
+                                                  ((WIDTH+12) / tile_cols, HEIGHT / tile_rows)).convert()
     for x in range(tile_cols):
         for y in range(tile_rows):
             if y == 0:
diff --git a/menu.py b/menu.py
index 21ac97bd3c49785191b6a76079222d44d30831f1..5d49572e8f3077a95262310170c3a076920a7714 100644 (file)
--- a/menu.py
+++ b/menu.py
@@ -11,7 +11,7 @@ class Menu:
     tile_cols = 4
     tile_rows = 4
     background_tile = pygame.transform.scale(pygame.image.load("assets/background.png"),
-                                             (WIDTH / tile_cols, HEIGHT / tile_rows)).convert()
+                                             ((WIDTH+12) / tile_cols, (HEIGHT+12) / tile_rows)).convert()
     for x in range(tile_cols):
         for y in range(tile_rows):
             background.blit(background_tile, (x * WIDTH / tile_cols, y * HEIGHT / tile_rows))
index 0c2acedf736f4eeca691d638a498313a732c816b..b869faa42fe58277bc1e131ffbee2cb394151e05 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ from functools import cache
 pygame.init()
 WIDTH, HEIGHT = pygame.display.Info().current_w, pygame.display.Info().current_h
 display = pygame.display.set_mode((WIDTH, HEIGHT), pygame.FULLSCREEN)
-window = Window.from_display_module()
+window = Window(size=(WIDTH,HEIGHT), fullscreen=True)
 renderer = Renderer(window)
 pygame.mouse.set_visible(False)