Added reset button
This commit is contained in:
parent
f968827b7b
commit
aa631c188e
15
gamedata/objects/resetbutton.py
Normal file
15
gamedata/objects/resetbutton.py
Normal file
@ -0,0 +1,15 @@
|
||||
from gamedata.objects.button import Button
|
||||
|
||||
class Reset(Button):
|
||||
|
||||
def __init__(self,x,y,game,w,h):
|
||||
|
||||
super().__init__(x,y,game,w,h)
|
||||
|
||||
self.text = "Reset save"
|
||||
|
||||
def reset(self,game):
|
||||
game.globals["highscore"] = 0
|
||||
game.scene = game.scenes.main
|
||||
|
||||
self.click = reset
|
@ -9,6 +9,7 @@ from gamedata.objects.ingame.manager import Manager
|
||||
from gamedata.objects.gameover import GameOver
|
||||
from gamedata.objects.ingame.skies import Skies
|
||||
from gamedata.objects.ingame.clouds import Clouds
|
||||
from gamedata.objects.resetbutton import Reset
|
||||
|
||||
def main(game):
|
||||
game.scaleCamera()
|
||||
@ -38,9 +39,11 @@ def options(game):
|
||||
game.globals["cameray"] = 0
|
||||
s = BGMSlider(40,40,game,400,40)
|
||||
s2 = SFXSlider(40,100,game,400,40)
|
||||
btn = Reset(40,160 ,game,400,40)
|
||||
menu = OptionMenu(round(game.DISPLAY_WIDTH/8),round(game.DISPLAY_HEIGHT*9/10),game,round(game.DISPLAY_WIDTH*6/8),round(game.DISPLAY_HEIGHT/10-game.DISPLAY_HEIGHT/30))
|
||||
game.gameloop.summon(s)
|
||||
game.gameloop.summon(s2)
|
||||
game.gameloop.summon(btn)
|
||||
game.gameloop.summon(menu)
|
||||
|
||||
def gameover(game):
|
||||
|
Loading…
Reference in New Issue
Block a user