aboutsummaryrefslogtreecommitdiff
path: root/src/GUI.py
diff options
context:
space:
mode:
authorMoisis <moisis.george@yahoo.com>2023-05-19 23:41:23 +0300
committerGitHub <noreply@github.com>2023-05-19 23:41:23 +0300
commit271af3b2b85ac05aa8061cef0f35e7540f90b778 (patch)
treea0475e1d88be01716e76f2e75c495a4284290bb9 /src/GUI.py
parent8eeb31dba61e8c9b29704c5988f95dcba4338fca (diff)
parent6a351ed2d6a554ed6d338abba234527705d1040f (diff)
downloadMacpan-master.tar.xz
Macpan-master.zip
Merge pull request #7 from omagdy7/FinalMISOHEADmaster
Final Touches
Diffstat (limited to 'src/GUI.py')
-rw-r--r--src/GUI.py126
1 files changed, 0 insertions, 126 deletions
diff --git a/src/GUI.py b/src/GUI.py
deleted file mode 100644
index 21cec17..0000000
--- a/src/GUI.py
+++ /dev/null
@@ -1,126 +0,0 @@
-import pygame
-import sys
-from GUIbutton import Button
-from src.game import Game
-import ctypes
-
-# icon on taskbar
-
-myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string
-ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
-
-
-pygame.init()
-
-SCREEN = pygame.display.set_mode((1280, 720))
-pygame.display.set_caption("Mac-Pan")
-
-BG = pygame.image.load("../assets/Background.png")
-
-icon = pygame.image.load("../assets/icon.png")
-pygame.display.set_icon(icon)
-
-
-
-def get_font(size): # Returns Press-Start-2P in the desired size
- return pygame.font.Font("../assets/PAC-FONT.TTF", size)
-
-
-# def play():
-# while True:
-# PLAY_MOUSE_POS = pygame.mouse.get_pos()
-#
-# SCREEN.fill("black")
-#
-# PLAY_TEXT = get_font(45).render("This is the PLAY screen.", True, "White")
-# PLAY_RECT = PLAY_TEXT.get_rect(center=(640, 260))
-# SCREEN.blit(PLAY_TEXT, PLAY_RECT)
-#
-# PLAY_BACK = Button(image=None, pos=(640, 460),
-# text_input="BACK", font=get_font(75), base_color="White", hovering_color="Green")
-#
-# PLAY_BACK.changeColor(PLAY_MOUSE_POS)
-# PLAY_BACK.update(SCREEN)
-#
-# for event in pygame.event.get():
-# if event.type == pygame.QUIT:
-# pygame.quit()
-# sys.exit()
-# if event.type == pygame.MOUSEBUTTONDOWN:
-# if PLAY_BACK.checkForInput(PLAY_MOUSE_POS):
-# main_menu()
-#
-# pygame.display.update()
-
-## Todo options sound options here ??
-def options():
- while True:
- OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
-
- SCREEN.fill("white")
-
- OPTIONS_TEXT = get_font(45).render("This is the OPTIONS screen.", True, "Black")
- OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(640, 260))
- SCREEN.blit(OPTIONS_TEXT, OPTIONS_RECT)
-
- OPTIONS_BACK = Button(image=None, pos=(640, 460),
- text_input="BACK", font=get_font(75), base_color="Black", hovering_color="Green")
-
- OPTIONS_BACK.changeColor(OPTIONS_MOUSE_POS)
- OPTIONS_BACK.update(SCREEN)
-
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- pygame.quit()
- sys.exit()
- if event.type == pygame.MOUSEBUTTONDOWN:
- if OPTIONS_BACK.checkForInput(OPTIONS_MOUSE_POS):
- main_menu()
-
- pygame.display.update()
-
-
-def main_menu():
- while True:
- SCREEN.blit(BG, (0, 0))
-
- MENU_MOUSE_POS = pygame.mouse.get_pos()
-
- MENU_TEXT = get_font(100).render("Mac-Pan", True, "#b68f40")
- MENU_RECT = MENU_TEXT.get_rect(center=(640, 100))
-
- PLAY_BUTTON = Button(image=pygame.image.load("../assets/Play Rect.png"), pos=(640, 250),
- text_input="PLAY", font=get_font(75), base_color="#d7fcd4", hovering_color="White")
- OPTIONS_BUTTON = Button(image=pygame.image.load("../assets/Options Rect.png"), pos=(640, 400),
- text_input="OPTIONS", font=get_font(75), base_color="#d7fcd4", hovering_color="White")
- QUIT_BUTTON = Button(image=pygame.image.load("../assets/Quit Rect.png"), pos=(640, 550),
- text_input="QUIT", font=get_font(75), base_color="#d7fcd4", hovering_color="White")
-
- SCREEN.blit(MENU_TEXT, MENU_RECT)
-
- for button in [PLAY_BUTTON, OPTIONS_BUTTON, QUIT_BUTTON]:
- button.changeColor(MENU_MOUSE_POS)
- button.update(SCREEN)
-
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- pygame.quit()
- sys.exit()
- if event.type == pygame.MOUSEBUTTONDOWN:
- if PLAY_BUTTON.checkForInput(MENU_MOUSE_POS):
- #play()
- game = Game()
- game.run()
-
- if OPTIONS_BUTTON.checkForInput(MENU_MOUSE_POS):
- options()
- if QUIT_BUTTON.checkForInput(MENU_MOUSE_POS):
- pygame.quit()
- sys.exit()
-
- pygame.display.update()
-
-
-
-
-main_menu()