Compare commits

..

No commits in common. "3a1e866ced3adb274436d137be490ebd30f1b92b" and "41ab3722fcf7085281ae5ce7d685cf4d33205c4f" have entirely different histories.

8 changed files with 8 additions and 5 deletions

View File

@ -36,6 +36,7 @@ class Game():
mapdico["backgrounds"] = []
mapdico["data"] = None
mapdico["filler"] = None
mapdico["bgm"] = None
mapdico["tilesets"] = {}
scanner = os.scandir(path=mapfolder)
for i in scanner: # Je check tout les fichiers du dossier
@ -50,6 +51,10 @@ class Game():
mapdico["filler"] = pygame.image.load(i.path).convert_alpha()
else:
mapdico["tilesets"][i.name] = pygame.image.load(i.path).convert_alpha()
if len(name)==7:
if name.startswith("bgm"):
if name.endswith(".wav") or name.endswith(".ogg") or name.endswith(".mp3"):
mapdico["bgm"] = pygame.mixer.Sound(i.path)
except:
self.log("Erreur",mapfolder,name,"Fichier invalide")
if name=="map.json":
@ -92,7 +97,6 @@ class Game():
self.globals["completedlevels"] = [] # Levels where the player kicked all non-respawnable ennemies
self.globals["speedrunlevels"] = [] # Levels where the player finished fast enough
self.globals["allunlocked"] = True
self.globals["bgms"] = ["city.ogg","docks.ogg","isle.ogg","isle.ogg","docks.ogg","city.ogg"]
self.init_inputs()
self.scaleCamera()

Binary file not shown.

Binary file not shown.

View File

@ -80,10 +80,9 @@ class TilesetRenderer(BaseObject):
self.spikes = []
self.layers = []
self.spawns = []
self.bgm = None
if "levelname" in self.game.globals.keys():
self.bgm = self.game.sound_lib["bgm/"+self.game.globals["bgms"][self.game.globals["levelname"]]]
self.bgm = level["bgm"]
if self.bgm:
self.bgm.set_volume(self.game.globals["bgmvolume"])
self.bgm.play(-1)
spawnlists = {"Spawns":self.spawns}
ennemies = {"Robot":Robot,"Crate":Crate,"Balloon":Balloon,"Spring":Spring,"WaterChange":WaterChange,"Levels":Levels,"End":EndFlag,"TrashBag":TrashBag,"Ripple":Ripple,"Squid":Squid,"Shooter":Shooter}

View File

@ -15,7 +15,7 @@ class Water(BaseObject):
self.depth = 2
self.sprite = game.pygame.Surface((game.DISPLAY_WIDTH,game.DISPLAY_HEIGHT))
self.sprite.set_alpha(130)
self.sprite.set_alpha(180)
white = [245,237,186]
cyan = [126,196,193]