-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
57 lines (30 loc) · 858 Bytes
/
main.py
File metadata and controls
57 lines (30 loc) · 858 Bytes
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
import pygame
from engine import Engine
from map import *
from Objects.Blocks.brick import Brick
pygame.init()
pygame.mixer.init()
gmap = Map(50, 50)
gmap.map[40] = [ObjectEnum.BRICK for i in range(50)]
gmap.map[45] = [ObjectEnum.BRICK for i in range(50)]
def main():
width, height = 800, 600
quit : bool = False
main_engine = Engine(width, height)
main_engine.load_map(gmap)
clock = pygame.time.Clock()
fps = 60
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("JMP")
while not quit:
clock.tick(fps)
for event in pygame.event.get():
if event.type == pygame.QUIT:
quit = True
main_engine.render()
main_engine.manage_action(pygame.key.get_pressed())
main_engine.manage_movement()
main_engine.garbage_collection()
main_engine.redraw(screen)
if __name__ == "__main__":
main()