-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
57 lines (42 loc) · 1.5 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
############################################################################
# TheJummonRunner Created By Matin Afzal
# https://github.com/MatinAfzal
# contact.matin@yahoo.com
############################################################################
import pygame as pg
import settings
import functions as fc
import matin
from button import Button
# File identity information
__author__ = 'Matin Afzal (contact.matin@yahoo.com)'
__version__ = '0.0.1'
__last_modification__ = '2023/07/2'
# Assign Settings class
set = settings.Settings()
# Initialization of pygame
pg.init()
# Creating screen surface
screen = pg.display.set_mode(set.resolotion)
clock = pg.time.Clock()
pg.display.set_caption(set.caption)
# Assign Matin class
matin_rect = matin.Matin(set, screen)
bullets = pg.sprite.Group()
font = pg.font.Font(None, 24)
text_box = pg.Rect(850, 0, 50, 50)
# define starting time
play_button = Button(set, screen, "Play")
github_button = Button(set, screen, "My Github", True)
# Load back ground music
# Main loop
def main():
while set.run:
for event in pg.event.get():
fc.check_event(event, matin_rect, bullets, play_button, matin_rect, github_button)
fc.screen_background(screen, set.screen_color) # fill screen background
fc.screen_draw(clock, screen, matin_rect, bullets, text_box, font, play_button, github_button)
pg.display.update() # update screen
pg.quit()
if __name__ == "__main__":
main()