From 73537ee635776b24c7f776041c73438ee7c84bf1 Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 20 Mar 2016 23:35:23 +0100 Subject: [PATCH] little cleanup --- pybottle/bottle-blaster.py | 1 + pybottle/storm_games.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 pybottle/bottle-blaster.py mode change 100644 => 100755 pybottle/storm_games.py 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))] +