Fixed overworld bugs

This commit is contained in:
theo@manjaro 2021-11-28 15:25:02 +01:00
parent 7bb10926a2
commit 9125706a21
2 changed files with 6 additions and 4 deletions

View File

@ -94,7 +94,7 @@ class Game():
self.globals["overworld"] = True self.globals["overworld"] = True
self.globals["nblevels"] = 0 self.globals["nblevels"] = 0
self.globals["levelname"] = None self.globals["levelname"] = None
self.globals["allunlocked"] = True self.globals["allunlocked"] = False
self.globals["bgms"] = ["city.ogg","docks.ogg","isle.ogg","isle.ogg","docks.ogg","city.ogg"] self.globals["bgms"] = ["city.ogg","docks.ogg","isle.ogg","isle.ogg","docks.ogg","city.ogg"]
self.init_inputs() self.init_inputs()
self.scaleCamera() self.scaleCamera()

View File

@ -71,13 +71,15 @@ class Levels(BaseObject):
if not self.moving and not self.launched: if not self.moving and not self.launched:
if self.game.inputs["keys"]["right"]["timer"]>0: if self.game.inputs["keys"]["right"]["timer"]>0:
if "Level "+str(self.cursor+1) in self.game.globals["finishedlevels"] or self.game.globals["allunlocked"]: if self.cursor in self.game.globals["finishedlevels"] or self.game.globals["allunlocked"]:
self.cursor+=1 self.cursor+=1
if self.cursor<=len(self.nodes)-1:
self.sfx.play() self.sfx.play()
self.flip = False self.flip = False
if self.game.inputs["keys"]["left"]["timer"]>0: if self.game.inputs["keys"]["left"]["timer"]>0:
self.cursor-=1 self.cursor-=1
self.flip = True self.flip = True
if self.cursor>=0:
self.sfx.play() self.sfx.play()
if self.game.inputs["keys"]["up"]["timer"]==1: if self.game.inputs["keys"]["up"]["timer"]==1:
# Launch the level # Launch the level