-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
65 lines (51 loc) · 1.87 KB
/
main.py
File metadata and controls
65 lines (51 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Example file showing a basic pygame "game loop"
import pygame
import constants
from windows import (
SmallAppWindow,
LargeAppWindow,
)
# pygame setup
pygame.init()
screen = pygame.display.set_mode((constants.SCREEN_WIDTH, constants.SCREEN_HEIGHT))
pygame.display.set_caption("Selective Memories")
clock = pygame.time.Clock()
running = True
lg_window = LargeAppWindow(0, 0)
sm_window1 = SmallAppWindow(735, 0)
sm_window2 = SmallAppWindow(735, 372)
while running:
lg_window.draw(screen)
sm_window1.draw(screen)
sm_window2.draw(screen)
# poll for events
# pygame.QUIT event means the user clicked X to close your window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.MOUSEBUTTONDOWN:
# left_click = pygame.mouse.get_pressed()[0]
# middle_click = pygame.mouse.get_pressed()[1]
# right_click = pygame.mouse.get_pressed()[2]
x, y = pygame.mouse.get_pos()
if lg_window.clicked(event):
print("LG Window Clicked")
if sm_window1.clicked(event):
print("SM Windows 1 Clicked")
if sm_window2.clicked(event):
print("SM Window 2 Clicked")
# if lg_window.rect.collidepoint(x, y):
# print("LG Window Clicked")
# if left_click:
# print(f"left mouse click at {pygame.mouse.get_pos()}")
# elif middle_click:
# print(f"middle mouse click at {pygame.mouse.get_pos()}")
# elif right_click:
# print(f"right mouse click at {pygame.mouse.get_pos()}")
# fill the screen with a color to wipe away anything from last frame
# screen.fill("purple")
# RENDER YOUR GAME HERE
# flip() the display to put your work on screen
pygame.display.flip()
clock.tick(175) # limits FPS to 60
pygame.quit()