diff --git a/pybottle/bottle-blaster.py b/pybottle/bottle-blaster.py old mode 100644 new mode 100755 index 3155281..5dd47bc --- a/pybottle/bottle-blaster.py +++ b/pybottle/bottle-blaster.py @@ -1,4 +1,5 @@ #!/bin/python +# -*- coding: utf-8 -*- # Shoot the bottles as fast as possible. from storm_games import * diff --git a/pybottle/storm_games.py b/pybottle/storm_games.py old mode 100644 new mode 100755 index ccfe5a6..a7c1c33 --- a/pybottle/storm_games.py +++ b/pybottle/storm_games.py @@ -1,6 +1,10 @@ +#!/bin/python +# -*- coding: utf-8 -*- """Standard initializations and functions shared by all games.""" import os +from os import listdir +from os.path import isfile, join import pygame import time @@ -11,7 +15,6 @@ def initialize_gui(gameTitle): pygame.display.set_mode((320, 200)) pygame.display.set_caption(gameTitle) # Load sounds from the sound directory - soundFileNames = next(os.walk("sounds/"))[2] - for i in soundFileNames: - if i[-4:] == ".ogg": i[:-4] = pygame.mixer.Sound("sounds/" + i) + onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] +