Fixed overworld bugs
This commit is contained in:
parent
7bb10926a2
commit
9125706a21
@ -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()
|
||||||
|
@ -71,14 +71,16 @@ 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
|
||||||
self.sfx.play()
|
if self.cursor<=len(self.nodes)-1:
|
||||||
|
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
|
||||||
self.sfx.play()
|
if self.cursor>=0:
|
||||||
|
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
|
||||||
t = Transition(self.game,level = "Level "+str(self.cursor+1))
|
t = Transition(self.game,level = "Level "+str(self.cursor+1))
|
||||||
|
Loading…
Reference in New Issue
Block a user