little cleanup

This commit is contained in:
chrys 2016-03-20 23:35:23 +01:00
parent 63a5f17c0c
commit 73537ee635
2 changed files with 7 additions and 3 deletions

1
pybottle/bottle-blaster.py Normal file → Executable file
View File

@ -1,4 +1,5 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Shoot the bottles as fast as possible.
from storm_games import *

9
pybottle/storm_games.py Normal file → Executable file
View File

@ -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))]