-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
79 lines (58 loc) · 1.87 KB
/
main.py
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import pygame
import sys
import random
from math import *
import physics_engine
import objects
import maps
import interface
pygame.init()
width = 1366
height = 768
display = pygame.display.set_mode((width, height))
clock = pygame.time.Clock()
physics_engine.init(display)
objects.init(display)
maps.init(display)
interface.init(display)
background = (51, 51, 51)
def close():
pygame.quit()
sys.exit()
def start_game(map):
map.draw_map()
def GAME():
map = maps.Maps()
welcome = interface.Label(700, 100, 400, 200, None, background)
welcome.add_text("ANGRY BIRDS", 80,
"Fonts/arfmoochikncheez.ttf", (236, 240, 241))
start = interface.Button(
500, 400, 300, 100, start_game, (244, 208, 63), (247, 220, 111))
start.add_text("START GAME", 60, "Fonts/arfmoochikncheez.ttf", background)
exit = interface.Button(1000, 400, 300, 100, close,
(241, 148, 138), (245, 183, 177))
exit.add_text("QUIT", 60, "Fonts/arfmoochikncheez.ttf", background)
LeoParadox10 = interface.Button(width - 300, height -
80, 300, 100, None, background)
LeoParadox10.add_text("LeoParadox10", 60,
"Fonts/arfmoochikncheez.ttf", (41, 41, 41))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
close()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_q:
close()
if event.type == pygame.MOUSEBUTTONDOWN:
if exit.isActive():
exit.action()
if start.isActive():
start_game(map)
display.fill(background)
start.draw()
exit.draw()
welcome.draw()
LeoParadox10.draw()
pygame.display.update()
clock.tick(60)
GAME()