More effects and tweaks
This commit is contained in:
BIN
effects/over.mp3
BIN
effects/over.mp3
Binary file not shown.
BIN
music/bubbles.ogg
Normal file
BIN
music/bubbles.ogg
Normal file
Binary file not shown.
9
snake.py
9
snake.py
@@ -56,6 +56,8 @@ class Game:
|
|||||||
curses.init_pair(self.colors['white'], curses.COLOR_WHITE, curses.COLOR_BLACK) # Score/Text
|
curses.init_pair(self.colors['white'], curses.COLOR_WHITE, curses.COLOR_BLACK) # Score/Text
|
||||||
self.stdscr.bkgd(' ', curses.color_pair(self.colors['white']))
|
self.stdscr.bkgd(' ', curses.color_pair(self.colors['white']))
|
||||||
|
|
||||||
|
curses.set_escdelay(1)
|
||||||
|
|
||||||
# Get terminal (screen) height and width
|
# Get terminal (screen) height and width
|
||||||
self.screen_height, self.screen_width = self.stdscr.getmaxyx()
|
self.screen_height, self.screen_width = self.stdscr.getmaxyx()
|
||||||
|
|
||||||
@@ -387,7 +389,10 @@ def sound_process(sound_queue):
|
|||||||
# Load sounds/music (adjust file paths as needed)
|
# Load sounds/music (adjust file paths as needed)
|
||||||
# Use .wav or .ogg for better compatibility
|
# Use .wav or .ogg for better compatibility
|
||||||
#effect = pygame.mixer.Sound('effects/bing.mp3')
|
#effect = pygame.mixer.Sound('effects/bing.mp3')
|
||||||
music_file = 'music/QonsVivaEveryone.mp3'
|
#music_file = 'music/QonsVivaEveryone.mp3'
|
||||||
|
#music_file = 'music/Aztec.mp3'
|
||||||
|
#music_file = 'music/Snug_Neon_Artery.mp3'
|
||||||
|
music_file = 'music/bubbles.ogg'
|
||||||
#music_file = 'music/s.mp3'
|
#music_file = 'music/s.mp3'
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -402,7 +407,7 @@ def sound_process(sound_queue):
|
|||||||
# Play music
|
# Play music
|
||||||
if command == 'music.start':
|
if command == 'music.start':
|
||||||
pygame.mixer.music.load(music_file)
|
pygame.mixer.music.load(music_file)
|
||||||
pygame.mixer.music.set_volume(0.25)
|
pygame.mixer.music.set_volume(0.5)
|
||||||
pygame.mixer.music.play(-1) # Play music indefinitely
|
pygame.mixer.music.play(-1) # Play music indefinitely
|
||||||
elif command == 'music.stop':
|
elif command == 'music.stop':
|
||||||
pygame.mixer.music.stop()
|
pygame.mixer.music.stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user