PinmikPanik/gamedata/objects/gameover.py

26 lines
831 B
Python

from gamedata.objects.base import BaseObject
from gamedata.objects.button import Button
class GameOver(BaseObject):
def __init__(self,game):
super().__init__(0,0,game)
# Back button function
def fnBack(self,game):
game.scene = game.scenes.main
# Creating the back button
btn = Button(int(game.DISPLAY_WIDTH/4),int(game.DISPLAY_HEIGHT*0.8),game,game.DISPLAY_WIDTH//2,int(game.DISPLAY_HEIGHT*0.1))
btn.text = "Back"
btn.click = fnBack
game.gameloop.summon(btn)
# Updating highscore
self.highscore = False
if game.globals["highscore"]<game.globals["score"]:
game.globals["highscore"] = game.globals["score"]
self.highscore = True
def draw(self):
# Display score and highscore
pass