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["nblevels"] = 0
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.init_inputs()
self.scaleCamera()

View File

@ -71,14 +71,16 @@ class Levels(BaseObject):
if not self.moving and not self.launched:
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.sfx.play()
if self.cursor<=len(self.nodes)-1:
self.sfx.play()
self.flip = False
if self.game.inputs["keys"]["left"]["timer"]>0:
self.cursor-=1
self.flip = True
self.sfx.play()
if self.cursor>=0:
self.sfx.play()
if self.game.inputs["keys"]["up"]["timer"]==1:
# Launch the level
t = Transition(self.game,level = "Level "+str(self.cursor+1))