]> Skullheadx's Git Forge - fruit-ninja.git/commitdiff
web stuff web-version
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Wed, 5 Jul 2023 02:06:36 +0000 (22:06 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Wed, 5 Jul 2023 02:06:36 +0000 (22:06 -0400)
21 files changed:
Fruit Ninja.exe [deleted file]
assets/logo.ico [deleted file]
assets/logo.png [new file with mode: 0644]
assets/sounds/Swishes/long-medium-swish-44324.ogg [new file with mode: 0644]
assets/sounds/Swishes/long-medium-swish-44324.wav [deleted file]
assets/sounds/Swishes/swing-6045.ogg [new file with mode: 0644]
assets/sounds/Swishes/swing-6045.wav [deleted file]
assets/sounds/Swishes/swish-sound-94707.ogg [new file with mode: 0644]
assets/sounds/Swishes/swish-sound-94707.wav [deleted file]
assets/sounds/hq-explosion-6288.ogg [new file with mode: 0644]
assets/sounds/hq-explosion-6288.wav [deleted file]
assets/sounds/medium-explosion-40472.ogg [new file with mode: 0644]
assets/sounds/medium-explosion-40472.wav [deleted file]
assets/sounds/sub-bass-4-secondsssss-6241.ogg [new file with mode: 0644]
assets/sounds/sub-bass-4-secondsssss-6241.wav [deleted file]
bomb.py
game.py
high_score.txt
main.py
menu.py
setup.py

diff --git a/Fruit Ninja.exe b/Fruit Ninja.exe
deleted file mode 100644 (file)
index 214d847..0000000
Binary files a/Fruit Ninja.exe and /dev/null differ
diff --git a/assets/logo.ico b/assets/logo.ico
deleted file mode 100644 (file)
index 7fbbb81..0000000
Binary files a/assets/logo.ico and /dev/null differ
diff --git a/assets/logo.png b/assets/logo.png
new file mode 100644 (file)
index 0000000..850a6b9
Binary files /dev/null and b/assets/logo.png differ
diff --git a/assets/sounds/Swishes/long-medium-swish-44324.ogg b/assets/sounds/Swishes/long-medium-swish-44324.ogg
new file mode 100644 (file)
index 0000000..0373924
Binary files /dev/null and b/assets/sounds/Swishes/long-medium-swish-44324.ogg differ
diff --git a/assets/sounds/Swishes/long-medium-swish-44324.wav b/assets/sounds/Swishes/long-medium-swish-44324.wav
deleted file mode 100644 (file)
index 140ddf2..0000000
Binary files a/assets/sounds/Swishes/long-medium-swish-44324.wav and /dev/null differ
diff --git a/assets/sounds/Swishes/swing-6045.ogg b/assets/sounds/Swishes/swing-6045.ogg
new file mode 100644 (file)
index 0000000..4d91740
Binary files /dev/null and b/assets/sounds/Swishes/swing-6045.ogg differ
diff --git a/assets/sounds/Swishes/swing-6045.wav b/assets/sounds/Swishes/swing-6045.wav
deleted file mode 100644 (file)
index 192c421..0000000
Binary files a/assets/sounds/Swishes/swing-6045.wav and /dev/null differ
diff --git a/assets/sounds/Swishes/swish-sound-94707.ogg b/assets/sounds/Swishes/swish-sound-94707.ogg
new file mode 100644 (file)
index 0000000..54b9f2b
Binary files /dev/null and b/assets/sounds/Swishes/swish-sound-94707.ogg differ
diff --git a/assets/sounds/Swishes/swish-sound-94707.wav b/assets/sounds/Swishes/swish-sound-94707.wav
deleted file mode 100644 (file)
index 1bedb42..0000000
Binary files a/assets/sounds/Swishes/swish-sound-94707.wav and /dev/null differ
diff --git a/assets/sounds/hq-explosion-6288.ogg b/assets/sounds/hq-explosion-6288.ogg
new file mode 100644 (file)
index 0000000..db0d56e
Binary files /dev/null and b/assets/sounds/hq-explosion-6288.ogg differ
diff --git a/assets/sounds/hq-explosion-6288.wav b/assets/sounds/hq-explosion-6288.wav
deleted file mode 100644 (file)
index 1ef2cdd..0000000
Binary files a/assets/sounds/hq-explosion-6288.wav and /dev/null differ
diff --git a/assets/sounds/medium-explosion-40472.ogg b/assets/sounds/medium-explosion-40472.ogg
new file mode 100644 (file)
index 0000000..67539ec
Binary files /dev/null and b/assets/sounds/medium-explosion-40472.ogg differ
diff --git a/assets/sounds/medium-explosion-40472.wav b/assets/sounds/medium-explosion-40472.wav
deleted file mode 100644 (file)
index f0621b4..0000000
Binary files a/assets/sounds/medium-explosion-40472.wav and /dev/null differ
diff --git a/assets/sounds/sub-bass-4-secondsssss-6241.ogg b/assets/sounds/sub-bass-4-secondsssss-6241.ogg
new file mode 100644 (file)
index 0000000..1f6e204
Binary files /dev/null and b/assets/sounds/sub-bass-4-secondsssss-6241.ogg differ
diff --git a/assets/sounds/sub-bass-4-secondsssss-6241.wav b/assets/sounds/sub-bass-4-secondsssss-6241.wav
deleted file mode 100644 (file)
index 80da76d..0000000
Binary files a/assets/sounds/sub-bass-4-secondsssss-6241.wav and /dev/null differ
diff --git a/bomb.py b/bomb.py
index 133934e7eb5ac8c3ad31af0611b505edeb39ccdd..2ecc41de20283c384d03765c9ed5495b56882d07 100644 (file)
--- a/bomb.py
+++ b/bomb.py
@@ -43,8 +43,8 @@ class Bomb(Fruit):
     EXPLOSION_TIME = 500
 
     explosion_sound_effects = [
-        pygame.mixer.Sound("assets/sounds/hq-explosion-6288.wav"),
-        pygame.mixer.Sound("assets/sounds/medium-explosion-40472.wav"),
+        pygame.mixer.Sound("assets/sounds/hq-explosion-6288.ogg"),
+        pygame.mixer.Sound("assets/sounds/medium-explosion-40472.ogg"),
     ]
 
     def __init__(self):
diff --git a/game.py b/game.py
index b07d96c91ef956a3262e77544e058f769aaf2c80..23d8d5e6a268d2ed9456d34805826827c08aee14 100644 (file)
--- a/game.py
+++ b/game.py
@@ -29,11 +29,11 @@ class Game:
                 BACKGROUND.blit(background_tile, (x * WIDTH / tile_cols, y * HEIGHT / tile_rows))
     BACKGROUND = Texture.from_surface(renderer, BACKGROUND)
 
-    bass_sound_effect = pygame.mixer.Sound("assets/sounds/sub-bass-4-secondsssss-6241.wav")
+    bass_sound_effect = pygame.mixer.Sound("assets/sounds/sub-bass-4-secondsssss-6241.ogg")
     bass_sound_effect.set_volume(0.1)
-    slash_sounds = [pygame.mixer.Sound(f"assets/sounds/Swishes/long-medium-swish-44324.wav"),
-                    pygame.mixer.Sound(f"assets/sounds/Swishes/swing-6045.wav"),
-                    pygame.mixer.Sound(f"assets/sounds/Swishes/swish-sound-94707.wav"),
+    slash_sounds = [pygame.mixer.Sound(f"assets/sounds/Swishes/long-medium-swish-44324.ogg"),
+                    pygame.mixer.Sound(f"assets/sounds/Swishes/swing-6045.ogg"),
+                    pygame.mixer.Sound(f"assets/sounds/Swishes/swish-sound-94707.ogg"),
                     ]
 
     HIGH_SCORE_FILE = "high_score.txt"
index c227083464fb9af8955c90d2924774ee50abb547..95738485793d46fac341b01b1f8f9468b4df0dd1 100644 (file)
@@ -1 +1 @@
-0
\ No newline at end of file
+326
\ No newline at end of file
diff --git a/main.py b/main.py
index 2053bfe5167b889899f2a259eb0663e79b5ca79a..8045b775ff94888e01dad0d96e215e401cefc23d 100644 (file)
--- a/main.py
+++ b/main.py
@@ -1,31 +1,41 @@
+import asyncio
+import pygame
+from pygame._sdl2 import Window, Renderer, Texture, Image
+import random
+import os
+import math
+from setup import *
 from game import Game
 from menu import Menu
-from setup import *
 
-FPS = 60
-clock = pygame.time.Clock()
 
-scene = Menu()
+async def main():
+    FPS = 60
+    clock = pygame.time.Clock()
+
+    scene = Menu()
+    is_running = True
+    while is_running:
+        delta = clock.tick(FPS)
+        renderer.clear()
 
-is_running = True
-while is_running:
-    delta = clock.tick(FPS)
-    renderer.clear()
+        status = scene.update(delta)
+        scene.draw()
 
-    status = scene.update(delta)
-    scene.draw()
+        # fps_text = font_small.render(f"FPS: {clock.get_fps():.0f}", True, DARK_GRAY)
+        # fps_txt = Texture.from_surface(renderer, fps_text)
+        # fps_txt.draw(None, pygame.Vector2(10, 75))
 
-    # fps_text = font_small.render(f"FPS: {clock.get_fps():.0f}", True, DARK_GRAY)
-    # fps_txt = Texture.from_surface(renderer, fps_text)
-    # fps_txt.draw(None, pygame.Vector2(10, 75))
+        renderer.present()
+        await asyncio.sleep(0)
 
-    renderer.present()
+        if status == COMMAND_EXIT:
+            is_running = False
+        elif status == COMMAND_START:
+            scene = Game()
+        elif status == COMMAND_MENU:
+            scene = Menu()
 
-    if status == COMMAND_EXIT:
-        is_running = False
-    elif status == COMMAND_START:
-        scene = Game()
-    elif status == COMMAND_MENU:
-        scene = Menu()
+    pygame.quit()
 
-pygame.quit()
+asyncio.run(main())
diff --git a/menu.py b/menu.py
index 21ac97bd3c49785191b6a76079222d44d30831f1..c705dba71976468bcfa4f67c8099b6f8d63c2569 100644 (file)
--- a/menu.py
+++ b/menu.py
@@ -19,9 +19,9 @@ class Menu:
 
     # Slash sound effects
     slash_sounds = [
-        pygame.mixer.Sound(f"assets/sounds/Swishes/long-medium-swish-44324.wav"),
-        pygame.mixer.Sound(f"assets/sounds/Swishes/swing-6045.wav"),
-        pygame.mixer.Sound(f"assets/sounds/Swishes/swish-sound-94707.wav"),
+        pygame.mixer.Sound(f"assets/sounds/Swishes/long-medium-swish-44324.ogg"),
+        pygame.mixer.Sound(f"assets/sounds/Swishes/swing-6045.ogg"),
+        pygame.mixer.Sound(f"assets/sounds/Swishes/swish-sound-94707.ogg"),
     ]
 
     def __init__(self):
index 0c2acedf736f4eeca691d638a498313a732c816b..2089d93750844adbd2be8e3ef9596745cce8462b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,13 @@
+import asyncio
 import pygame
 from pygame._sdl2 import Window, Renderer, Texture, Image
 import random
 import os
 import math
-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)
+display = pygame.display.set_mode((WIDTH, HEIGHT))
 window = Window.from_display_module()
 renderer = Renderer(window)
 pygame.mouse.set_visible(False)
@@ -15,7 +15,7 @@ pygame.mouse.set_visible(False)
 SCALE = pygame.Vector2(WIDTH / 1536, HEIGHT / 864)
 
 pygame.display.set_caption("Fruit Shinobi")
-icon = pygame.image.load("assets/logo.ico").convert()
+icon = pygame.image.load("assets/logo.png").convert()
 pygame.display.set_icon(icon)
 
 # fonts