From 4d9578c2fb3a19bac8564e6ecff44a1c14967e62 Mon Sep 17 00:00:00 2001 From: <vc2310@LAPTOP-FCB0H0KM.localdomain> Date: Fri, 9 Nov 2018 15:14:39 -0500 Subject: [PATCH] a --- BlankProjectTemplate/src/Snake_Game.py | 9 +++++---- BlankProjectTemplate/src/highscore.py | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/BlankProjectTemplate/src/Snake_Game.py b/BlankProjectTemplate/src/Snake_Game.py index ec3f43d..ac5b537 100644 --- a/BlankProjectTemplate/src/Snake_Game.py +++ b/BlankProjectTemplate/src/Snake_Game.py @@ -1,6 +1,6 @@ #importing necessary libraries import pygame, sys - +import highscore class GUI(): #a function made to execute other files from the system def runfile(runfilename): @@ -49,8 +49,8 @@ def main(): if ( 10 <= mousepos[0] <= 310 and 550 <= mousepos[1] <= 550 +55): GUI.button(game,[200,0,0],[10,550,300,55], 0) if mouseclick[0] == 1: - GUI.runfile('highscore.py') - #highscore.main() + #GUI.runfile('highscore.py') + highscore.main() else: GUI.button(game,[180,180,180], [10,550,300,55], 0) GUI.text('HIGHEST SCORE',"comicsansms", 35,(0, 0, 0),(10,550),game) @@ -67,7 +67,8 @@ def main(): pygame.display.update() -main() +if __name__ == "__main__": + main() diff --git a/BlankProjectTemplate/src/highscore.py b/BlankProjectTemplate/src/highscore.py index 9f919a4..8eef23b 100644 --- a/BlankProjectTemplate/src/highscore.py +++ b/BlankProjectTemplate/src/highscore.py @@ -1,5 +1,5 @@ import pygame, sys -from tkinter import * +import Snake_Game class HighScore(): def runfile(runfilename): @@ -38,7 +38,8 @@ def main(): HighScore.text('Main Menu',"times", 25,red,(90,70),highscore) if (90 <= mousepos[0] <= 90+120 and 70 <= mousepos[1] <= 70+27 ): if mouseclick[0] == 1: - HighScore.runfile('Snake_Game.py') + #HighScore.runfile('Snake_Game.py') + Snake_Game.main() HighScore.button(highscore,[0,0,0], [125,105,45,27], 0) HighScore.text('Quit',"times", 25,red,(125,105),highscore) @@ -49,4 +50,4 @@ def main(): pygame.display.update() -main() +#main() -- GitLab