little cleanup
This commit is contained in:
parent
63a5f17c0c
commit
73537ee635
1
pybottle/bottle-blaster.py
Normal file → Executable file
1
pybottle/bottle-blaster.py
Normal file → Executable file
@ -1,4 +1,5 @@
|
|||||||
#!/bin/python
|
#!/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Shoot the bottles as fast as possible.
|
# Shoot the bottles as fast as possible.
|
||||||
|
|
||||||
from storm_games import *
|
from storm_games import *
|
||||||
|
9
pybottle/storm_games.py
Normal file → Executable file
9
pybottle/storm_games.py
Normal file → Executable file
@ -1,6 +1,10 @@
|
|||||||
|
#!/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
"""Standard initializations and functions shared by all games."""
|
"""Standard initializations and functions shared by all games."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from os import listdir
|
||||||
|
from os.path import isfile, join
|
||||||
import pygame
|
import pygame
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -11,7 +15,6 @@ def initialize_gui(gameTitle):
|
|||||||
pygame.display.set_mode((320, 200))
|
pygame.display.set_mode((320, 200))
|
||||||
pygame.display.set_caption(gameTitle)
|
pygame.display.set_caption(gameTitle)
|
||||||
# Load sounds from the sound directory
|
# Load sounds from the sound directory
|
||||||
soundFileNames = next(os.walk("sounds/"))[2]
|
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
|
||||||
for i in soundFileNames:
|
|
||||||
if i[-4:] == ".ogg": i[:-4] = pygame.mixer.Sound("sounds/" + i)
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user