Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Irber <luiz.irber@gmail.com>2008-04-19 20:39:49 (GMT)
committer Luiz Irber <luiz.irber@gmail.com>2008-04-19 20:39:49 (GMT)
commit52346854caa1f09963106ac4fd69335e599a6eed (patch)
treeb234fc2bd98619838503782be49663f160863c7b
parentff8ca69ac522a0a26f5311981dfa6d9394bf0e68 (diff)
used os.path.join() on artwork paths
-rw-r--r--Gambiarra/command.py11
-rw-r--r--Gambiarra/gambiarra.py6
-rw-r--r--Gambiarra/gamemenu.py12
-rw-r--r--Gambiarra/objects/animals.py7
-rw-r--r--Gambiarra/objects/balls.py18
-rw-r--r--Gambiarra/objects/elastica.py8
-rw-r--r--Gambiarra/objects/esteira.py11
-rw-r--r--Gambiarra/objects/target.py4
8 files changed, 53 insertions, 24 deletions
diff --git a/Gambiarra/command.py b/Gambiarra/command.py
index 4508d6c..b2db177 100644
--- a/Gambiarra/command.py
+++ b/Gambiarra/command.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
class Command(pygame.sprite.Sprite):
@@ -37,14 +39,17 @@ class Command(pygame.sprite.Sprite):
class Play(Command):
def __init__(self):
Command.__init__(self,
- pygame.image.load("data/images/playButton.png") )
+ pygame.image.load(os.path.join("data", "images",
+ "playButton.png")) )
class Help(Command):
def __init__(self):
Command.__init__(self,
- pygame.image.load("data/images/helpButton.png") )
+ pygame.image.load(os.path.join("data", "images",
+ "helpButton.png")) )
class Quit(Command):
def __init__(self):
Command.__init__(self,
- pygame.image.load("data/images/quitButton.png") )
+ pygame.image.load(os.path.join("data", "images",
+ "quitButton.png")) )
diff --git a/Gambiarra/gambiarra.py b/Gambiarra/gambiarra.py
index e44de89..41dbbf8 100644
--- a/Gambiarra/gambiarra.py
+++ b/Gambiarra/gambiarra.py
@@ -21,6 +21,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import sys
+import os.path
import pygame
@@ -62,9 +63,10 @@ class Game(object):
self.clock = pygame.time.Clock()
self.levels = Levels.init_levels()
self.menu = GameMenu()
- self.congrats = pygame.image.load("data/images/fim_fase.png")
+ self.congrats = pygame.image.load(os.path.join("data","images",
+ "fim_fase.png"))
if self.play_sounds:
- snd_file = "data/snd/Congrats.wav"
+ snd_file = os.path.join("data", "snd", "Congrats.wav")
self.congrats_snd = pygame.mixer.Sound(snd_file)
self._showed_help = False
self.count = 0
diff --git a/Gambiarra/gamemenu.py b/Gambiarra/gamemenu.py
index f9e7782..2945b98 100644
--- a/Gambiarra/gamemenu.py
+++ b/Gambiarra/gamemenu.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
class GameMenu(object):
@@ -31,7 +33,7 @@ class GameMenu(object):
# pygame.init()
# pygame.display.set_mode((1280,800))
self.screen = pygame.display.get_surface()
- bg_file = "data/images/background.png"
+ bg_file = os.path.join("data", "images", "background.png")
self.background = pygame.image.load(bg_file)
# mudar o arquivo de logotipo
# self.level = LevelButton(350)
@@ -120,9 +122,9 @@ class LevelButton(object):
clicked = None
def __init__(self, position, levels_number = 1):
- img = "data/images/nivel_normal.png"
+ img = os.path.join("data", "images", "nivel_normal.png")
non_hover = pygame.image.load(img)
- img = "data/images/nivel_hover.png"
+ img = os.path.join("data", "images", "nivel_hover.png")
hover = pygame.image.load(img)
self.img = [non_hover, hover]
self.position = [600 - non_hover.get_width()/2, position]
@@ -150,9 +152,9 @@ class StartButton(object):
clicked = None
def __init__(self, position):
- img = "data/images/iniciar_normal.png"
+ img = os.path.join("data", "images", "iniciar_normal.png")
non_hover = pygame.image.load(img)
- img = "data/images/iniciar_hover.png"
+ img = os.path.join("data", "images", "iniciar_hover.png")
hover = pygame.image.load(img)
self.img = [non_hover, hover]
self.position = [600 - non_hover.get_width()/2 - 50, position]
diff --git a/Gambiarra/objects/animals.py b/Gambiarra/objects/animals.py
index 8ce1d41..9b3114a 100644
--- a/Gambiarra/objects/animals.py
+++ b/Gambiarra/objects/animals.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
from things import Thing
@@ -26,11 +28,12 @@ from things import Thing
class Penguin(Thing):
def __init__(self, initial_pos=None, editable=True):
if pygame.mixer.get_init():
- snd = pygame.mixer.Sound("data/snd/penguin.wav")
+ snd = pygame.mixer.Sound(os.path.join("data", "snd",
+ "penguin.wav"))
else:
snd = None
Thing.__init__(self,
- pygame.image.load("data/images/penguin.png"),
+ pygame.image.load(os.path.join("data", "images", "penguin.png")),
editable, snd,
initial_pos, elasticity = 100, mobility = True,
gravity = 5)
diff --git a/Gambiarra/objects/balls.py b/Gambiarra/objects/balls.py
index e0607eb..3546d34 100644
--- a/Gambiarra/objects/balls.py
+++ b/Gambiarra/objects/balls.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
from things import Thing
@@ -26,33 +28,37 @@ from things import Thing
class BowlingBall(Thing):
def __init__(self, initial_pos=None, editable=True):
if pygame.mixer.get_init():
- snd = pygame.mixer.Sound("data/snd/BowlingBall.wav")
+ snd = pygame.mixer.Sound(os.path.join("data", "snd",
+ "BowlingBall.wav"))
else:
snd = None
Thing.__init__(self,
- pygame.image.load("data/images/bolaBoliche.png"),
+ pygame.image.load(os.path.join("data", "images",
+ "bolaBoliche.png")),
editable, snd,
initial_pos, elasticity = 60, mobility = True, gravity = 5)
class BeachBall(Thing):
def __init__(self, initial_pos=None, editable=True):
if pygame.mixer.get_init():
- snd = pygame.mixer.Sound("data/snd/BowlingBall.wav")
+ snd = pygame.mixer.Sound(os.path.join("data", "snd",
+ "BowlingBall.wav"))
else:
snd = None
Thing.__init__(self,
- pygame.image.load("data/images/bola.png"),
+ pygame.image.load(os.path.join("data", "images", "bola.png")),
editable, snd,
initial_pos, elasticity = 90, mobility = True, gravity = 5)
class SoccerBall(Thing):
def __init__(self, initial_pos=None, editable=True):
if pygame.mixer.get_init():
- snd = pygame.mixer.Sound("data/snd/BowlingBall.wav")
+ snd = pygame.mixer.Sound(os.path.join("data", "snd",
+ "BowlingBall.wav"))
else:
snd = None
Thing.__init__(self,
- pygame.image.load("data/images/futebol.png"),
+ pygame.image.load(os.path.join("data", "images", "futebol.png")),
editable, snd,
initial_pos, elasticity = 70, mobility = True,
gravity = 5)
diff --git a/Gambiarra/objects/elastica.py b/Gambiarra/objects/elastica.py
index 7395e22..01dd9d8 100644
--- a/Gambiarra/objects/elastica.py
+++ b/Gambiarra/objects/elastica.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
from things import Thing
@@ -27,11 +29,13 @@ class Elastica(Thing):
def __init__(self, initial_pos = None, editable=True):
if pygame.mixer.get_init():
- snd = pygame.mixer.Sound("data/snd/cama_elastica.wav")
+ snd = pygame.mixer.Sound(os.path.join("data", "snd",
+ "cama_elastica.wav"))
else:
snd = None
Thing.__init__(self,
- pygame.image.load("data/images/cama_elastica.png"),
+ pygame.image.load(os.path.join("data", "images",
+ "cama_elastica.png")),
editable, snd,
initial_pos, elasticity = 100, mobility = False,
gravity = 10)
diff --git a/Gambiarra/objects/esteira.py b/Gambiarra/objects/esteira.py
index 02a3316..f17fe59 100644
--- a/Gambiarra/objects/esteira.py
+++ b/Gambiarra/objects/esteira.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
from things import Thing
@@ -29,13 +31,16 @@ class Esteira(Thing):
def __init__(self, initial_pos = (0, 0), editable=True):
Thing.__init__(self,
- pygame.image.load("data/images/esteira_dir.png"),
+ pygame.image.load(os.path.join("data", "images",
+ "esteira_dir.png")),
editable, None,
initial_pos, elasticity = 100, mobility = False,
gravity = 10)
self.sentido = 1
- self.image_dir = pygame.image.load("data/images/esteira_dir.png")
- self.image_esq = pygame.image.load("data/images/esteira_esq.png")
+ self.image_dir = pygame.image.load(os.path.join("data", "images",
+ "esteira_dir.png"))
+ self.image_esq = pygame.image.load(os.path.join("data", "images",
+ "esteira_esq.png"))
def draw(self, screen, pos):
# temos a imagem na variavel <img> e
diff --git a/Gambiarra/objects/target.py b/Gambiarra/objects/target.py
index c455995..69bbca5 100644
--- a/Gambiarra/objects/target.py
+++ b/Gambiarra/objects/target.py
@@ -19,6 +19,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import os.path
+
import pygame
from things import Thing
@@ -26,7 +28,7 @@ from things import Thing
class Target(Thing):
def __init__(self, initial_pos=None, editable=True):
Thing.__init__(self,
- pygame.image.load("data/images/target.png"),
+ pygame.image.load(os.path.join("data", "images", "target.png")),
editable, None,
initial_pos, elasticity = 100, mobility = False,
gravity = 10)